| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| Hi, I wanna add a element to my $PATH and remove it later on. So I think I can write two shell script to do the adding and removing, but you know, any "export" statement executed in a shell script will take no effect on current shell. So my script will not be of use. So, how do I do? Thanks. - woody |
|
#2
|
| * Steven Woody > Hi, > > I wanna add a element to my $PATH and remove it later on. So I think > I can write two shell script to do the adding and removing, but you > know, any "export" statement executed in a shell script will take no > effect on current shell. So my script will not be of use. So, how do > I do? Source your scripts in the current shell using the '.' command. For example: $ . add2path > Thanks. > > - > woody -- James Michael Fultz Remove this part when replying ^^^^^^^^ |
|
#3
|
| On Aug 28, 1:10 pm, James Michael Fultz > * Steven Woody > > > Hi, > > > I wanna add a element to my $PATH and remove it later on. So I think > > I can write two shell script to do the adding and removing, but you > > know, any "export" statement executed in a shell script will take no > > effect on current shell. So my script will not be of use. So, how do > > I do? > > Source your scripts in the current shell using the '.' command. > For example: > > $ . add2path > > > Thanks. > > > - > > woody > > -- > James Michael Fultz > Remove this part when replying ^^^^^^^^ Thank you. |
|
#4
|
| On Aug 27, 10:20 pm, Steven Woody > On Aug 28, 1:10 pm, James Michael Fultz > > * Steven Woody > > > I wanna add a element to my $PATH and remove it later on. So I think > > > I can write two shell script to do the adding and removing, but you > > > know, any "export" statement executed in a shell script will take no > > > effect on current shell. So my script will not be of use. So, how do > > > I do? > > Source your scripts in the current shell using the '.' command. > > For example: > > $ . add2path Or have the script/program write shell commands as output, and use eval, e.g.: eval `my_program` |
![]() |
| Thread Tools | |
| Display Modes | |