shell将输入的参数逆序
2015-09-15 10:51
405 查看
#! /usr/bin/ksh
count=$# //总共输入参数
cmd="echo"
while [[ $count -gt 0 ]]
do
cmd="$cmd \$$count "
count=`expr $count - 1`
done
eval $cmd
count=$# //总共输入参数
cmd="echo"
while [[ $count -gt 0 ]]
do
cmd="$cmd \$$count "
count=`expr $count - 1`
done
eval $cmd
相关文章推荐
- PowerShell打开或关闭光驱
- 我的Android进阶之旅------>Android中通过adb shell input来模拟滑动、按键、点击事件
- bash脚本高阶技巧
- bash循环,判断语句总结
- PowerShell中的加法运算详解
- PowerShell时间记录脚本
- Bash shell中的位置参数$#,$*,$@,$0,$1,$2...及特殊参数$?,$-等的含义
- bash编程之:条件测试
- shell简介及变量、脚本相关概念
- Linux(Fedora)学习使用之gnome-shell
- Linux:Shell 常用通配符
- Linux:常用shell快捷键
- shell的执行问题
- Bash 实例
- linux Shell学习笔记3
- linux Shell学习笔记2
- linux Shell学习笔记1
- 交互式shell和非交互式shell的区别
- Shell脚本中遇到的一些细节问题
- [转]实现Hive数据同步更新的shell脚本