This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cygwin-bash compat/regression bug... startup line prob


This 'used' to work...but doesn't now: -- running
bash with the "-u" flag:

t.sh
/usr/bin/bash: - : invalid option
Usage:  /usr/bin/bash [GNU long option] [option] ...
        /usr/bin/bash [GNU long option] [option] script-file ...
GNU long options:
        --debug
        --debugger
        --dump-po-strings
        --dump-strings
        --help
        --init-file
        --login
        --noediting
        --noprofile
        --norc
        --posix
        --protected
        --rcfile
        --restricted
        --verbose
        --version
        --wordexp
Shell options:
        -irsD or -c command or -O shopt_option          (invocation only)
        -abefhkmnptuvxBCHP or -o option
which t.sh
/Users/law.Bliss/bin/t.sh
cat bin/t.sh
#!/bin/bash -u -x
echo "Hello World"

-----------------------------

It has something to do with the "-u" switch -- the "-x" was
added to try to figure out why a script that had just
#!/bin/bash -u
died w/o executing a single line.

If I run it via:
bash t.sh
Hello World

---works---
Also weird -- the interp line says "/bin/bash" not "/usr/bin/bash"
as the shell, so why does the error come from /usr/bin/bash?

It doesn't when I do it interactively:
/bin/bash - -
/bin/bash: -: No such file or directory
---
or 'bash' alone:
bash - -
bash: -: No such file or directory


----
Ideas?  would a cygcheck be of any use?

Note, if I combine the switches (-ux), it works -- but I only
added the '-x' to debug why '-u' didn't work.

uname -a
CYGWIN_NT-6.1 Athenae 1.7.29(0.272/5/3) 2014-04-07 13:46 x86_64 Cygwin
bash --version
GNU bash, version 4.1.11(2)-release (x86_64-unknown-cygwin)

---
This, also, doesn't work:
echo t.sh|bash -i     #(with or without '-i')
#note -- first some unrelated output from confused startup scripts:

User Bliss\law's .bashrc called 2nd time
/usr/bin/stty: standard input: Inappropriate ioctl for device
/usr/bin/stty: standard input: Inappropriate ioctl for device
dirname: extra operand `a'
Try `dirname --help' for more information.
## here is the 'echo' being read into bash:

law.Bliss> t.sh
/usr/bin/bash: - : invalid option
Usage:  /usr/bin/bash [GNU long option] [option] ...
        /usr/bin/bash [GNU long option] [option] script-file ...
GNU long options:
...
-----


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]