the target is to use the variable of A.ksh into B.ksh .
because the same variable can be used differently in both the script and
in real time both the script will run pararlly and one script can not call other.
Variables defined in a script belong to that script, so when you start a new script it uses a new set of variables. So I don't think if there are any other option other than sourcing. But please don't consider my opinion as final, somebody else in this forum will have a solution.
There is no need to export a variable if one is only sourcing the other file. Variables are exported so that they work if one script calls another script in a subshell:
A.ksh:
If the scripts are to be run in parallel then you could use a third script, export the variable there and run both scripts in parallel in the background..
Or you can have a third file, set the variables there, and source the file in either script. You only need to export those variables if those scripts in turn call other scripts in a subshell that need that variable...
--
As a side note. The shebang #! only works if there is no space between the two characters, otherwise it is just a comment.
Last edited by Scrutinizer; 11-28-2012 at 10:38 AM..
I have given the relevant details below. Why are the libraries in
/export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r are invisible to ldd?
%setenv
... (3 Replies)
I typically pull a bunch of data via SQL that lists a bunch of users and the server on which they want to access, as well as other attributes, in one row of an excel sheet and the number of rows is directly proportionate to the number of users.
I'm trying to write a loop to read each line of the... (2 Replies)
Hi,
I have the following executable in cron:
10 * * * 1-5 /apps/bin/dmg_cronlaunch -ENVI ENVIRONMENT -EXE exec -FILE ratespb_sdos_prdf_`TZ=US/Eastern;date +\%Y\%m\%d\%H\%M\%S`.sdos > /tmp/dmg_exec.log.`/usr/bin/date +\%Y_\%m_\%d_\%H:\%M:\%S` 2>&1
Comprised of the following:
... (13 Replies)
I have a filesystem that was exported sometime in the past, probably by NIM processes, but cannot be unexported now. How can I get rid of this? Any ideas? I tried rebooting and it survived it.
hostname:/:$ exportfs -v
/usr/lpp/bos.sysmgt/nim/methods... (2 Replies)
Hi
I'm hoping someone can tell me how to extend the scope of an exported function in the korn shell.
I have written a function in a file that I dot in from my .kshrc file and it works fine.
However I would like this function to be available to anyone in a certain group on the machine... (10 Replies)
Dear All,How can use a variable which I have exported when I am logged into one user to be used once I su to another user.something like 1.Login to Unix box as user12. export var1="TEST"3. su - user24. User the var1 value ( it should return TEST)I have checked just export does not work. any other... (1 Reply)
Greeting to all of you!
I've small issue related to the variable which we are setting and exporting through scripts, in one of the script there are some variable used but I am not abel to get the detail as where they are set. I tried finding the detail with the help of env but no luck.
... (2 Replies)
I had a pool which was exported and due to some issues on my SAN i was never able to import it again. Can anyone tell me how can i destroy the exported pool to free up the LUN. I tried to create a new pool on the same pool but it gives me following error
# zpool create emcpool4 emcpower0c... (0 Replies)
While I know that it's possible to use something like SANE to share a USB scanner over a network, or use NBD or iSCSI to share a USB flash or external HD over the network, I've been wondering about a raw USB <--> TCP/IP transport. Back in the late 90s, I swear I remember hearing about a project... (2 Replies)