由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - 请问script的问题
相关主题
A basic question on Linuxshell programming
test有关Unix shell script的问题
请问如何在一个目录下查询所有以某文件名开头的文where can I find some good website for C Shell ?
question about the set up directoryShell Script
[转载] Re: SUPER PI Test Summary (update2)问一个Unix Shell Script 的问题
Re: Bash一问:怎么includeCGI之Perl Script一问
which shell is best?help on sed
DD weijing!segmentation fault when using "script"
相关话题的讨论汇总
话题: run话题: tests话题: runa话题: runb话题: 问题
进入Unix版参与讨论
1 (共1页)
m********e
发帖数: 23
1
遇到一个写脚本的问题,下面注释是我的问题,哪位大侠指点一下?谢谢!
TESTS="a b"
RUNa='date'
RUNb='who'
for i in $TESTS
do
run="RUN$i"
#here I want to run the command stored in $run, how to do it?
#cannot use ${$run}
done
t*****g
发帖数: 1275
2

command $run

【在 m********e 的大作中提到】
: 遇到一个写脚本的问题,下面注释是我的问题,哪位大侠指点一下?谢谢!
: TESTS="a b"
: RUNa='date'
: RUNb='who'
: for i in $TESTS
: do
: run="RUN$i"
: #here I want to run the command stored in $run, how to do it?
: #cannot use ${$run}
: done

c***g
发帖数: 30
3
This should work.
TESTS="a b"
RUNa='date'
RUNb='who'
for i in $TESTS
do
run="RUN$i"
eval comm=\$"$run"
$comm
done
1 (共1页)
进入Unix版参与讨论
相关主题
segmentation fault when using "script"[转载] Re: SUPER PI Test Summary (update2)
[转载] Perl高手请进Re: Bash一问:怎么include
a Unix shell script questionwhich shell is best?
为什么我就是不会写Shell script?DD weijing!
A basic question on Linuxshell programming
test有关Unix shell script的问题
请问如何在一个目录下查询所有以某文件名开头的文where can I find some good website for C Shell ?
question about the set up directoryShell Script
相关话题的讨论汇总
话题: run话题: tests话题: runa话题: runb话题: 问题