在执行脚本时,提示:unary operator expected.

COMPUTERZZZ 2005-08-16 01:35:22
我的脚本是:
文件名: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.
...全文
624 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

19,614

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧