args

来自「UNIX+shell范例精解(第4版)代码」· 代码 · 共 23 行

TXT
23
字号
#!/bin/sh# Scriptname: args# Script to test command line argumentsecho The name of this script is $0.echo The arguments are $*.echo The first argument is $1.echo The second argument is $2.echo The number of arguments is $#.oldargs=$*      # Save parameters passed in from the command line	                    set Jake Nicky Scott   # Reset the positional parametersecho All the positional parameters are $*.echo The number of postional parameters is $#.echo "Good-bye for now, $1 "set `date`          #  Reset the positional parametersecho The date is $2 $3, $6.echo "The value of \$oldargs is $oldargs."set $oldargsecho $1 $2 $3

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?