[plug] bash bodgy

Craig Dyke grail at westnet.com.au
Sat Jun 5 20:04:39 WST 2004


Bernard Blackham wrote:

>On Sat, Jun 05, 2004 at 07:41:55PM +0800, Craig Dyke wrote:
>  
>
>>I WANT to be in 'home' when script completes.
>>After googling I found info to say that if I put either of the following:
>>
>>source cd ${home}
>>    
>>
>
>When you source a script (or use .), it runs the commands in the
>current shell. What you're after is to have a shell script that
>contains the line "cd $HOME", and source (or .) the script. Else
>what happens is the chdir is performed in a separate process which
>then exits.
>
>eg:
>
>--gohome.sh--
>cd $HOME
>----
>
>and then:
>source gohome.sh
>or
>. ./gohome.sh
>
>This means you'll need to consciously execute the script by putting
>a . or "source" in front of the script name.
>  
>
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?

Craig




More information about the plug mailing list