This is the mail archive of the
cygwin
mailing list for the Cygwin project.
cygwin-bash compat/regression bug... startup line prob
- From: Linda Walsh <cygwin at tlinx dot org>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Mon, 28 Apr 2014 13:43:13 -0700
- Subject: cygwin-bash compat/regression bug... startup line prob
- Authentication-results: sourceware.org; auth=none
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