在执行脚本时,提示:unary operator expected.
我的脚本是:
文件名:test
#!/bin/csh
echo "there are $#argv arguments on the command line"
echo "the command you type is $argv[0]"
if($#argv>0) then
echo "Your first argument on the command line is $argv[1]"
endif
if($#argv>1) then
echo "Your second argument on the command line is $arg[2]"
endif
if($#argv>2) then
echo "Your argument on the command line is more than 2"
else
echo "Your argument on the command line is no more than 2"
endif
chmod +x test
执行时就提示;unary operator expected.