[clug] Braindead shell?

Kim Holburn kim.holburn at anu.edu.au
Wed Mar 24 07:43:07 GMT 2004

At 5:41 PM +1100 2004/03/24, Kim Holburn wrote:
>At 3:55 PM +1100 2004/03/24, Antti.Roppola at brs.gov.au wrote:
>>So I have a Perl script that works perfectly when run from my login, but it complains
>>bitterly when run in cron where it can't find stuff like FlexLM and Oracle.
>>Is there an easy means of (temporarily) nuking PATH, LD_LIBRARY_PATH, ORACLE_HOME
>>and all the other assumed variables within an xterm? That is, easier than writing another script
>>to un-set and re-set them?
>eval `printenv | grep -v ^PATH= | sed -e 's/=.*$//; s/^/unset / '`
>unset PATH

If you want to reset them the simplest way is to do it like this (all happens in a subshell:

eval `printenv | sed -e 's/=.*$//; s/^/unset / '`
do stuff
Kim Holburn 
Network Consultant - Telecommunications Engineering
Research School of Information Sciences and Engineering
Australian National University - Ph: +61 2 61258620 M: +61 0417820641
Email: kim.holburn at anu.edu.au  - PGP Public Key on request

Life is complex - It has real and imaginary parts.
     Andrea Leistra (rec.arts.sf.written.Robert-jordan)

More information about the linux mailing list