That's what I thought too, but upon testing it seems that PS1 is somehow special in this regard:
fs@zhenghe ~/tmp $ export $FOO=bar fs@zhenghe ~/tmp $ echo $PS1 \[\033[01;32m\]\u@\h\[\033[01;34m\] \w $\[\033[00m\] fs@zhenghe ~/tmp $ cat ps1test echo PS1 in this script is $PS1 PS1="foo $PS1" bash -c 'echo PS1 in another shell called from this script is $PS1' fs@zhenghe ~/tmp $ cat footest echo FOO in this script is $FOO FOO="foo $FOO" bash -c 'echo FOO in another shell called from this script is $FOO' fs@zhenghe ~/tmp $ ./footest FOO in this script is bar FOO in another shell called from this script is foo bar fs@zhenghe ~/tmp $ ./ps1test PS1 in this script is PS1 in another shell called from this script is fs@zhenghe ~/tmp $ export PS1 fs@zhenghe ~/tmp $ ./ps1test PS1 in this script is PS1 in another shell called from this script is fs@zhenghe ~/tmp $ PS1="$PS1" ./ps1test PS1 in this script is PS1 in another shell called from this script is fs@zhenghe ~/tmp $ (Please forgive any horrendously deprecated syntax I might have used above, I don't know much about shell :) ) -Keshav ---- Join us in #sagemath on irc.freenode.net! -- To post to this group, send an email to [email protected] To unsubscribe from this group, send an email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
