Change in behavior of bash / if [

Buchbinder, Barry (NIH/NIAID) [E] BBuchbinder@niaid.nih.gov
Wed Dec 18 03:02:00 GMT 2013


Today, a script that I use every day stated giving me the following
error message.  (I grant that it might have started earlier and I
didn't notice.)  Note that although it gave the error message, the
script seems to still have worked.

./lddir: line 77: [: too many arguments

Line 77 was as follows.  I'm testing whether $1 is "clip".

if [ x$1 = xclip ]

I fixed it with this.

if [ "x$1" = xclip ]

32-bit, everything was up to date.

I've solved my problem, but the change was unexpected and, for me,
inexplicable, so I thought that I'd report it.

Let me know if you want/need more information.

- Barry
  Disclaimer: Statements made herein are not made on behalf of NIAID.


--
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



More information about the Cygwin mailing list