shift
时间:2006-06-21 来源:huanghaojie
1 #!/bin/bash
2 # Using 'shift' to step through all the positional parameters.
3
4 # Name this script something like shft,
5 #+ and invoke it with some parameters, for example
6 # ./shft a b c def 23 skidoo
7
8 until [ -z "$1" ] # Until all parameters used up...
9 do
10 echo -n "$1 " # Don't output trailing newline
11 shift
12 done
13
14 echo # Extra line feed.
15
16 exit 0
#. ./shift a b c def 23 skidoo
相关阅读 更多 +