Re: [SLE] Using bash to change current environment, or...?
"Steven T. Hatton"
Hey,
If I wanted to run a bash script to, say, check out a tree from a cvs repository, and then leave me with a modified environment, how would I do it?
You would "source" the script -- in bash: . script_to_execute or you can also use the csh syntax with bash: ource script_to_execute This causes the current bash to read and interpret the script. (See help . help source and man bash) [snip] -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
Mark Gray wrote:
"Steven T. Hatton"
writes: Hey,
If I wanted to run a bash script to, say, check out a tree from a cvs repository, and then leave me with a modified environment, how would I do it?
You would "source" the script -- in bash:
. script_to_execute
or you can also use the csh syntax with bash:
source script_to_execute
This causes the current bash to read and interpret the script. (See help . help source and man bash)
[snip]
I had thought about sourcing the file, but I never tryed to source a file using the $PATH. For some strange reason I thought that was not possible. I just tried it, and it seems to work. Thanks! I have been using source for a lot of things, but I always give a full path to the surce file. Lean something new every day. Or unlearn something as the case may be. Steve -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
participants (2)
-
hattons@bellatlantic.net
-
markgray@iago.nac.net