![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Accessing variables of one shell script in another shell script | rsendhilmani | Shell Programming and Scripting | 2 | 03-17-2009 01:17 AM |
| invoking a shell script inside cgi shell script | smriti_shridhar | Shell Programming and Scripting | 2 | 07-09-2008 02:50 AM |
| How to pass a parameter from one Shell-script to another Shell-script | subodhbansal | Shell Programming and Scripting | 2 | 09-22-2007 06:19 AM |
| How to Run a shell script from Perl script in Parent shell? | hifake | Shell Programming and Scripting | 16 | 08-28-2007 09:42 PM |
| Have a shell script call another shell script and exit | heprox | Shell Programming and Scripting | 2 | 11-20-2006 08:17 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
subhendu81,I am afraid that might be wrong....Im not sure what it does but I am sure the script a.shl is not being run here....bcos I tested it by givin some echo statements in a.shl.....So a.shl is not being run here...Also note there is a space between "." and "a.shl"..so dot does not denote current dir
Last edited by vijay_0209; 09-17-2008 at 02:25 AM.. |
|
||||
|
The dot is the shell's "source" command. When you run one script from another, normally they are distinct processes, and the child process cannot change anything in the parent process. In some scenarios you want the invoked script to modify the invoker's environment (typically, to set some environment variables) and in those scenarios, the "source" command is the ticket.
In this particular case, the value of $a is visible inside a.shl after it sources b.shl. Without the dot, this would not be the case. (Conventionally .sh is used as the extension for shell scripts; but often, it's better to not have any extension.) |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|