|
发表于 2017-2-4 12:20:10
|
显示全部楼层
去掉了:q的话cshell会试图对?*之类的特殊字符做匹配处理,而不知把这些字符作为参数传给
cmd中的perl脚本。
http://www.grymoire.com/Unix/Csh.html
:q - Quote modifier
The C shell and Bourne shell behave differently whena filename pattern is used, and nothing matches.Suppose you have a shell script, named"test_me," that says# The test_me script, either sh or csh
echo $1
and you call it using:test_me ?
The Bourne shell will echo"?" which the C shell will report"echo: No match." You can disable this error by setting the nonomatch variable:#!/bin/csh -f
set nonomatch
echo $1
The other way to do this is to use the":q" modifier, which quotes the variable:#!/bin/csh -f
echo $1:q
|
|