正在加载图片...
位置参数变量 Shel程序的命令参数由分割符分开,被从左到右依次赋 给位置参数$O,$1,$2…第一个命令参数为$1,第二个 命令参数为$2,依次类推。$0表示命令名(shel程 序名)。 ◆示例程序 ◆执行过程及结果 cat postpile Ssh echo The first: 1 The first: first echo The second: $2 The second: second echo The third: $3 The third: third echo The fourth: $4 The fourth: fourth echo The program name: $O The program name: postfile $位置参数变量 • S h e l l程序的命令参数由分割符分开,被从左到右依次赋 给位置参数$0, $1, $2……第一个命令参数为$1,第二个 命令参数为$2,……依次类推。$0表示命令名(shell 程 序名)。 ‹示例程序 $cat postfile echo The first: $1 echo The second: $2 echo The third: $3 echo The fourth: $4 echo The program name: $0 $ ‹执行过程及结果 $sh postfile first second third fourth The first: first The second: second The third: third The fourth: fourth The program name: postfile $
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有