shell空数组
2016-03-16 02:18
357 查看
空数组也就是不经过初始化定义的数组,其不占用任何内存空间。空数组的使用可以更节省内存空间。
空数组中部含有数组元素。*在使用的时候需要注意空数组与含有空元素数组的区别
举例:
#!/usr/local/bin/bash
#
arry2={That\'s a non -empty array}
array3=()
array4=('')
#
ARRAY()
{
echo "Element of arry2 is:${array2[@]}."
echo "Element of array3 is:${array3[@]}."
echo "Element of array4 is:${array4[@]}."
}
ARRAY
echo
exit 0
空数组中部含有数组元素。*在使用的时候需要注意空数组与含有空元素数组的区别
举例:
#!/usr/local/bin/bash
#
arry2={That\'s a non -empty array}
array3=()
array4=('')
#
ARRAY()
{
echo "Element of arry2 is:${array2[@]}."
echo "Element of array3 is:${array3[@]}."
echo "Element of array4 is:${array4[@]}."
}
ARRAY
echo
exit 0
相关文章推荐
- shell二维数组
- shell一维数组
- 执行shell的时候开启调试模式
- SecureCRT连接Linux,操作HBase shell,不用使用Backspace键的设置方法
- Windows 10 IoT Raspberry Pi 2 相关PowerShell命令
- /bin/bash
- 高性能平台上提交任务的两种方式
- Hbase的shell命令
- 排序算法——shell排序
- 排序算法——shell排序
- bash脚本编程(一)
- Linux笔记(46)——bash变量
- bash脚本编程实践总结(图文)
- shell之进程管理
- shell之文本编辑
- shell之调试&分析
- Linux学习6之shell筛选当前目录下文件并逐个对其进行操作
- Linux学习5之shell显示当前目录下所有的文件和文件夹
- Xmanager Enterprise 4连接不上xshell
- About Zsh & Go2Shell & iTerm2