Change in behavior of bash / if [

Eric Blake eblake@redhat.com
Wed Dec 18 15:28:00 GMT 2013


On 12/18/2013 07:18 AM, Buchbinder, Barry (NIH/NIAID) [E] wrote:

>>> if [ "x$1" = xclip ]
>>
>> Yes, this is the correct fix for the improper quotation of the earlier
>> example.
> 
> But why would it need quoting unless the first argument unless the
> command line is quoted and might have a space"?  It wasn't.  It was
> called from a script that was being sourced by a bash interactive shell
> as follows.
> 
> lddir clip

I'd need to see your entire script to know for sure.  Perhaps you are
using calls to 'set' or using shell functions, either of which modifies
$1 from the value that you passed on the command line.  But the point
remains - your improper quoting of $1 is not a cygwin-specific issue.

> Speculation:  Since cygwin1.dll was updated last week, perhaps
> something happened there.

Less likely.  But without seeing your entire script, it's hard to say.
You haven't given anyone else enough to go on.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20131218/582d837b/attachment.sig>


More information about the Cygwin mailing list