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]

bash expands $1 in strange new way


I have a bash shell script named xplo that worked as desired under
cygwin 1.5. It fails under cygwin 1.7. Specifically, the shell expands
the expression
	$1
in a way that I simply cannot understand. This expression expanded to
the first shell script argument in cygwin 1.5. Not any more.

Here is the script xplo in its entirety:
#!/bin/bash
if [ $# -gt 1 ]
then
        echo "Usage: xplo path-or-file"
        exit 1
else
        set EXPLOR='/cygdrive/c/windows/explorer.exe'
        if [ $# -eq 0 ]
        then
                cygstart ${EXPLOR} /e,.
        elif [ -f "$1" ]
        then
                cygstart ${EXPLOR} /e,/select,`cygpath -w "$1"`
        else
                cygstart ${EXPLOR} /e,`cygpath -w "$1"`
        fi
fi

I cd to a directory that contains an ordinary file named wongo, as
well as the shell script xplo. I execute the command
	bash -x ./xplo wongo

I expect to get an instance of Windows Explorer, with folders showing,
and the file wongo selected (highlighted). This does not occur. The
text output from the above bash -x looks like this:
+ '[' 1 -gt 1 ']'
+ set EXPLOR=/cygdrive/c/windows/explorer.exe
+ '[' 1 -eq 0 ']'
+ '[' -f EXPLOR=/cygdrive/c/windows/explorer.exe ']'
++ cygpath -w EXPLOR=/cygdrive/c/windows/explorer.exe
+ cygstart '/e,EXPLOR=\cygdrive\c\windows\explorer.exe'
Unable to start 'E:\cygwin\e,EXPLOR=\cygdrive\c\windows\explorer.exe':
The specified file was not found.

I have attached the output from cygcheck -s -v -r. Thanks for any
advice.

Attachment: cygcheck.out
Description: Text document

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