GNU screen not seeing $SHELL env var?

Eric Blake eblake@redhat.com
Wed Jun 20 14:08:00 GMT 2012


On 06/20/2012 07:20 AM, Tom Rodman wrote:

>   $ echo $SHELL
>   /bin/bash
>   $ bash -c 'echo SHELL: $SHELL'  # does this prove SHELL is exported?
>   SHELL: /bin/bash

No.  And in fact, bash does not export SHELL by default, but defaults to
defining SHELL as a shell-local variable.  You have to explicitly export
it yourself if you want child processes to see it.

$ env -u SHELL bash -c 'echo $SHELL'
/bin/bash
$ env -u SHELL bash -c 'env | grep SHELL'
$ env -u SHELL bash -c 'export SHELL; env | grep SHELL'
SHELL=/bin/bash
$

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20120620/c78ac833/attachment.sig>


More information about the Cygwin mailing list