linux shell 札记
2016-01-13 19:35
357 查看
shell 数组
数组索引:单个元素索引: ${array
}
全部元素: ${array[*]} 或者 ${array[@]}
部分索引: ${array[2:]}
数组所有元素统一加前缀/后缀:
array=( "${array[@]/%/_content}" )
array=( "${array[@]/#/prefix_}" )
流程控制
for 语句for var in $(ls ./home/data) do sth done ---------------------------------- for ((i=0;i<cnt;i++)); do sth done ---------------------------------- for loop in 1 2 3 4 5 do echo "The value is: $loop" done
相关文章推荐
- badusb_nc反弹shell
- Azure PowerShell 和 Visual Studio 不同版本下载安装
- linux shell学习笔记(一)——光标移动、输出、函数、循环
- jmeter beanshell内容
- &&在shell
- Centos6笔记 -- Bash
- bash大括号参数扩展(Parameter Expansion)
- shell-echo
- shell 循环
- sed使用实例
- Shell脚本运行hive语句 | hive以日期建立分区表 | linux schedule程序 | sed替换文件字符串 | shell推断hdfs文件文件夹是否存在
- Powershell 提权框架-Powerup
- XCode集成shell脚本
- shell 数字运算
- shell命令批量杀死MySQL连接进程
- shell 引号
- pg常用自制shell脚本-tina
- 解决 Linux/Ubuntu: adb shell insufficient permissions for device 的问题
- powershell
- Fix for PowerShell Script Not Digitally Signed