Redian新闻
>
急问: 教教我这小小scrip错哪了?
avatar
急问: 教教我这小小scrip错哪了?# Unix - 噫吁兮,危乎高哉
w*e
1
我不明白 为什么变量path 不能带到ls命令中
#!/bin/csh -f
set path=./cs111b
ls -l $path
echo path=$path
libra% aa
ls: Command not found
path=./cs111b
可以马上回答吗? 谢谢
avatar
x*g
2
After you set path to a new value, ls cannot be found there.
You need to either include the path where ls locates to path variable,
or prefix ls with path.

【在 w**********e 的大作中提到】
: 我不明白 为什么变量path 不能带到ls命令中
: #!/bin/csh -f
: set path=./cs111b
: ls -l $path
: echo path=$path
: libra% aa
: ls: Command not found
: path=./cs111b
: 可以马上回答吗? 谢谢

avatar
m*e
3
it is "Command" not found, not "path" not found.
try a different variable name from "path".
$path turns out to be used by shell to find all "Command"s,
therefore if you set it to ./cs111b, all you can execute are
shell build-ins plus executables in ./cs111b/ only.

【在 x******g 的大作中提到】
: After you set path to a new value, ls cannot be found there.
: You need to either include the path where ls locates to path variable,
: or prefix ls with path.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。