[plug] bash bodgy

Tony Breeds magni at plug.linux.org.au
Sun Jun 6 08:15:46 WST 2004


On Sat, Jun 05, 2004 at 08:04:39PM +0800, Craig Dyke wrote:

> This would be all well and good but there is a significant amount of 
> scipt before this line.
> Will that matter?
> I understand what you have written and how it works for my small 
> example, but wonder if
> it will translate to larger problem?

If you're really worried about it then you can get really cautiosn and
do something like:

add:
alias Copied_Script="~/bin/Copied_script && cd ${home}"
to your shell's rc file (probably .bashrc) and then when ever you want
to run the script just call "Copied_Script".

All this does is run the script inside it's own shell (thus no
environment corruption etc etc) and then assuming the script returns
without error takes you home.

Of course things get slightly more complex if ${home} isn't set in a
normal environment.

-- 
Yours Tony

        Linux.Conf.AU       http://lca2005.linux.org.au/
        Apr 18-23 2005      The Australian Linux Technical Conference!



More information about the plug mailing list