$ cat f1 Hello there.Nice day.$ cat f2 Are you sure about that?$ cat f3 This is it.This is end(The Script)while( ) {print ;}print "The value of \$ARGV[0] is $ARGV[0].\n";(Output)$ argv.test f1 f2 f3Hello there.Nice day.Are you sure about that?This is

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/14 03:21:56

$ cat f1 Hello there.Nice day.$ cat f2 Are you sure about that?$ cat f3 This is it.This is end(The Script)while( ) {print ;}print "The value of \$ARGV[0] is $ARGV[0].\n";(Output)$ argv.test f1 f2 f3Hello there.Nice day.Are you sure about that?This is
$ cat f1 Hello there.Nice day.$ cat f2 Are you sure about that?$ cat f3 This is it.This is end
(The Script)
while( ) {print ;}
print "The value of \$ARGV[0] is $ARGV[0].\n";
(Output)
$ argv.test f1 f2 f3
Hello there.Nice day.
Are you sure about that?
This is it.
This is the end.
The value of $ARGV[0] is .
其中$ argv.test f1 f2 f3的作用是啥?怎样运行这段程序代码?
(The Script)中的代码是以 argv.test 作为文件名吗?

$ cat f1 Hello there.Nice day.$ cat f2 Are you sure about that?$ cat f3 This is it.This is end(The Script)while( ) {print ;}print "The value of \$ARGV[0] is $ARGV[0].\n";(Output)$ argv.test f1 f2 f3Hello there.Nice day.Are you sure about that?This is
argv.test是脚本文件名,f1 f2 f3是脚本参数,作用是传入f1 f2 f3参数执行argv.test.
你这个可能是Linux中的Shell脚本,先创建好argv.test这个脚本文件,如果argv.test放在了PATH变量中指定的系统目录中,就在Shell窗口执行argv.test f1 f2 f3命令,否则要带完整路径执行此命令.