More: [1.7] packaging problem? Both /usr/bin/ and /usr/lib/ are non-empty

Eric Blake ebb9@byu.net
Sat May 30 13:25:00 GMT 2009


According to Charles Wilson on 5/28/2009 4:06 PM:
> Eric Blake wrote:
>> Are there any environment variables at play, like BASH_ENV?  Can we write
>> a simple script that does at least:
>> echo $- $0 "$@"
>> shopt -p
>> for i in 0 1 2 3; do test -t $i; echo $?; done
>>
>> to see if that sheds any light on the environment?  Can we even isolate
>> whether it is the outer call to C:\cygwin-1.7\bin\bash.exe, or the inner
>> call to #!/bin/sh when the script is executed, which is sourcing the rc file?
> 
> 2009/05/28 14:00:01 running: C:\cygwin-1.7\bin\bash.exe --norc
> --noprofile -c /etc/postinstall/fake-bash.sh
> /cygdrive/h/.bashrc
> hB /etc/postinstall/fake-bash.sh

$- didn't include i, so the fake-bash.sh script is NOT interactive.

> shopt -u xpg_echo
> 1
> 1
> 1
> 1

and none of std{in,out,err} are terminals.  But since something is still
interactive, it seems like it must be the outer invocation of
c:\cygwin-1.7\bin\bash.exe, where we explicitly passed --norc.  I still
see no reason why the outer shell should be sourcing these files,
particularly since we did not ask it to be interactive, but since the
inner invocation claims to be non-interactive, it seems like it is the
outer shell doing it.  Maybe it would be worth temporarily patching
setup.exe to pass -cxv instead of -c to the outer invocation.  Or also try
patching it to do c:\cygwin-1.7\bin\bash.exe ... -c "echo outer: $- $0;
fake-bash.sh", so we can see whether .bashrc is being sourced before or
after the attempt to start the inner shell.  And we're certain that
SHELLOPTS, BASH_ENV, and ENV are not set?

-- 
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net



More information about the Cygwin-developers mailing list