Example 5-7. Using shift
#!/bin/bash # Using 'shift' to step through all the positional parameters. # Name this script something like shft, # and invoke it with some parameters, for example # ./shft a b c def 23 skidoo until [ -z "$1" ] # Until all parameters used up... do echo -n "$1 " shift done echo # Extra line feed. exit 0 |
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8503278/viewspace-890162/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/8503278/viewspace-890162/