[NBLUG/talk] fighting Ubuntu, and the "source" bash command
Eric Eisenhart
eric at nblug.org
Mon Jul 7 09:20:21 PDT 2008
On Mon, Jul 7, 2008 at 8:28 AM, Bob Blick <bobblick at ftml.net> wrote:
> I've been fighting with Ubuntu 8.04.1(yes it was time to replace my old
> 6.06 install which froze in X quite often) over the last few days, when
> using "sudo" environmental variables are not working properly in
> scripts(although it seemed to work in previous versions). Which leads me
> to the "source" command in bash. Here's the manpage:
"source" (aka ".") is used to run shell code in the *current* shell.
So, if your shell script takes an argument and makes some changes to a
file, you should still continue to use "./script". But if you want a
shell script that modifies the environment (say, to add stuff to your
path), you need to use "source", as in "source pathextender.sh".
A good example: if you change your .profile, .bashrc or .bash_profile
and want to see the changes right away, you'd run ". ~/.bashrc" or
"source ~/.bashrc".
--
Eric Eisenhart <*@eric.eisenhart.name>
http://eric.eisenhart.name/
IRC: Freiheit at freenode, AIM: falsch freiheit, ICQ: 48217244
More information about the talk
mailing list