![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| Passing environment variables to parent shells | konndanley | UNIX for Dummies Questions & Answers | 3 | 08-04-2007 05:15 PM |
| parent shell pid | maheshwin | Shell Programming and Scripting | 4 | 01-31-2007 12:19 AM |
| How to pass CSH variables up to the parent? | ElCaito | Shell Programming and Scripting | 0 | 11-30-2006 02:30 AM |
| How to know parent script | raki | SUN Solaris | 1 | 06-06-2006 04:03 AM |
| can you change direcotry using variables? | jsalz638 | Shell Programming and Scripting | 4 | 07-06-2004 08:09 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
How to change parent shell's variables?
I have a question about how to change variables in parent shell.
My script, test.sh, is below: #!/bin/sh # test.sh PATH=. The commands I ran for test: $ echo $PATH .:/usr/bin:/usr/sbin:/usr/local/sbin: $ sh test.sh $ echo $PATH .:/usr/bin:/usr/sbin:/usr/local/sbin: Note that when I run sh test.sh, the variable PATH was not changed. I know that I can run . test.sh to make it change PATH. But for some reason I have to run sh test.sh. So in this case, how to make child process change the variables in parent process? Thanks. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|