0

I am working with perl in csh. Now I am using get options thing. I want to use as

myperl -f temp1*.txt

But it won't go into code and give me error 'No match.' Currently I below things are working..

myperl -f temp1\*.txt

and

myperl -f "temp1*.txt"

How to get first thing working?

4

1 回答 1

1

It can't work. The asterisk is a special char in shell. So you need to escape it anyway.

Most characters (*, ', etc) are not interpreted (ie, they are taken literally) by means of placing them in double quotes (""). They are taken as is and passed on to the command being called. An example using the asterisk (*) goes:

$ echo *
case.shtml escape.shtml first.shtml 
functions.shtml hints.shtml index.shtml 
ip-primer.txt raid1+0.txt
$ echo *txt
ip-primer.txt raid1+0.txt
$ echo "*"
*
$ echo "*txt"
*txt

Source

于 2013-07-23T06:21:01.520 回答