making vars in bash script accessible from shell

Kevin D. Clark kclark at CetaceanNetworks.com
Thu Nov 7 16:39:40 EST 2002




[please configure your email program to wrap lines at around 72
 characters -- thanks...]







> What exactly happens when you source a script (as opposed to executing it)?

The current shell runs the script instead of fork()-ing a new shell to
run it instead.

> What I'm doing is using the PROMPT_COMMAND variable to execute the shell [BAD WRAP]
> 
> The problem is that this seems to only work at the moment Ire-source .bashrc [BAD WRAP]
> 
> I suppose I need to escape the value of PROMPT_COMMAND so that it is not [BAD WRAP]

Is

   PROMPT_COMMAND='pwd | perl -ne "chomp; print substr(\$_, 0, 30);"'

what you want?

Regards,

--kevin
-- 
Kevin D. Clark / Cetacean Networks / Portsmouth, N.H. (USA)
cetaceannetworks.com!kclark (GnuPG ID: B280F24E)
alumni.unh.edu!kdc




More information about the gnhlug-discuss mailing list