ITPub博客

首页 > 应用开发 > Java > bash scripts(5)

bash scripts(5)

原创 Java 作者:VampireAlchemis 时间:2007-01-13 15:46:17 0 删除 编辑

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
[@more@]s

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/8503278/viewspace-890162/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: bash scripts(3)
下一篇: File test operators
请登录后发表评论 登录
全部评论
  • 博文量
    32
  • 访问量
    240264