This is the mail archive of the cygwin@cygwin.com 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 expansion question


The man page for bash says:
Enclosing  characters  in single quotes preserves the lit-
eral value of each character within the quotes.  A  single
quote  may not occur between single quotes, even when pre-
ceded by a backslash.

If I write the following bash script( test.bash ):
#!/usr/bin/bash
echo Argument is $1

If I execute this script in a directory that does NOT constain
any perl (*.pl) files:

test.bash '*.pl'
I get as expected:  Argument is *.pl

However if there IS a perl file present I get:
Argument is filename.pl

BTW, I get exactly the same behavior if I use double quotes.
Am I missing something here?  I need to pass a literal pattern that
may contain wildcard characters into a bash script and not have the
shell expand it.

Thanks.
Lynn




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]