[NBLUG/talk] bash script wonder

Micxz micxz at slashdomain.com
Mon Oct 4 23:56:28 PDT 2004


OK This seems simple enough.
---------------------------------------
#!/bin/sh
if [ -d /opt/kde3/share/apps/konqueror/servicemenus ]
 then
 echo "SuSE. I think"
  if [ -z "$KDEDIR" ]
  then
  export KDEDIR=/opt/kde3
  echo "made it"
  echo $KDEDIR
  fi
fi
----------------------------------------
When I run it I get:
micxz at neptune:~> ./test.sh
SuSE. I think
made it
/opt/kde3

OK. Looks like worked right. both conditions are true. But I don't know 
why after the script exits I get:

micxz at neptune:~> env | grep KDEDIR
micxz at neptune:~> echo $KDEDIR

nada' Were did my environment var go? Thanks in advance'




More information about the talk mailing list