由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - 急问: 教教我这小小scrip错哪了?
相关主题
C++5.0的初级问题Re: 怎么在UNIX下面放CD?
怎么才能在Unix里连续跑10个c写的程序 (转载)what's the use of "ta"
再次急问: *.tgz 文件怎么解?have u use ";" in pine?
双面打印[转载] Re: 进入main()之前就死了
help on job control commandswhere can I find some good website for C Shell ?
wait on line: simple questiontwo silly questions :-(
How to use the command history in SUN?books about advanced UNIX command
how to run background process after logouthow to stop "at"
相关话题的讨论汇总
话题: path话题: cs111b话题: ls话题: scrip话题: command
进入Unix版参与讨论
1 (共1页)
w**********e
发帖数: 74
1
我不明白 为什么变量path 不能带到ls命令中
#!/bin/csh -f
set path=./cs111b
ls -l $path
echo path=$path
libra% aa
ls: Command not found
path=./cs111b
可以马上回答吗? 谢谢
x******g
发帖数: 3952
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
: 可以马上回答吗? 谢谢

m*e
发帖数: 155
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.

1 (共1页)
进入Unix版参与讨论
相关主题
how to stop "at"help on job control commands
what command is for changing the directory name?wait on line: simple question
how to limite the size of a file?How to use the command history in SUN?
lp service produce segmentation faulthow to run background process after logout
C++5.0的初级问题Re: 怎么在UNIX下面放CD?
怎么才能在Unix里连续跑10个c写的程序 (转载)what's the use of "ta"
再次急问: *.tgz 文件怎么解?have u use ";" in pine?
双面打印[转载] Re: 进入main()之前就死了
相关话题的讨论汇总
话题: path话题: cs111b话题: ls话题: scrip话题: command