![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Background execution of a script | Cameron | Shell Programming and Scripting | 2 | 10-03-2007 02:50 AM |
| error during the execution of script | surjyap | Shell Programming and Scripting | 1 | 08-24-2007 05:10 PM |
| pb with script execution | Cecile | UNIX for Dummies Questions & Answers | 3 | 09-14-2006 07:37 AM |
| Script execution information | manthasirisha | Shell Programming and Scripting | 12 | 07-07-2006 05:54 AM |
| execution of shell script | malaymaru | Shell Programming and Scripting | 5 | 06-13-2005 06:49 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Pb with script execution and variables
Hello,
Can somebody tell me the differnce between a call of a ksh with the dot : >. script.ksh and the call without the dot: >script.ksh In my script I have writen a test for the number of parameters: if [ $# -ne 0 ] then echo 'Usage : '$0 exit 1 fi as my script doesn't need any parameter if I call like this: >. script.ksh $# = $0 = -ksh which is wrong I can't do a correct test of my parameters, but if I remove the parameter test I can give value to variables, and these variables are known and have a value in my parent shell and can be used by other scripts If I call like this: >script.ksh $# = 0 $0 = script.ksh which is OK, but I want to export variables that must be used in other script and my variables remains unknown in my parent shell but it seems that I can execute other script that can see the variables.... I don't understand anything.... see you Cécile |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
The difference is
$> . script.ksh script.ksh is run in the current shell environment. $> script.ksh script.ksh is run in a new shell If you script doesn't take any parameters then you don't need to explicitly check for it do you? If you have defined functions in "script A" for example and you want them available to "script B" you could call "script A" inside "script B" with ". script A" |
|||
| Google The UNIX and Linux Forums |