public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Linda Walsh <cygwin@tlinx.org>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: cygwin-bash compat/regression bug...  startup line prob
Date: Mon, 28 Apr 2014 20:43:00 -0000	[thread overview]
Message-ID: <535EBD61.5080109@tlinx.org> (raw)

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

             reply	other threads:[~2014-04-28 20:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-28 20:43 Linda Walsh [this message]
2014-04-28 21:18 ` Eric Blake
2014-05-01  5:57   ` Linda Walsh
2014-05-01  6:41     ` Eric Blake
2014-05-01 18:11       ` Linda Walsh
2014-05-01 20:41         ` two execve() inconsistencies [was: cygwin-bash compat/regression bug... startup line prob] Eric Blake
2014-05-02 21:44           ` two execve() inconsistencies (was cygwin-bash compat/regression bug... startup line prob) Linda Walsh
2014-05-01 22:11 cygwin-bash compat/regression bug... startup line prob Linda Walsh
2014-05-02  1:33 ` Eric Blake
2014-05-03 19:01   ` Linda Walsh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=535EBD61.5080109@tlinx.org \
    --to=cygwin@tlinx.org \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).