打印当前路径文件名shell

回复 收藏
[root@bogon 20150109]# cat arr01.sh

array=(
    caimz
    leco
    icpc
    zhuminjie
    huzhipeng
    lirunqing
    chenle
    chenhongzhi
    jianglei
)
echo ---------------------
for((i=0;i<${#array[@]};i++))
do
    echo "This is num$i,then content is ${array[$i]}"
done
echo "The array Length is: ${#array[@]}"
echo ---------------------
执行结果
[root@bogon 20150109]# sh arr01.sh
---------------------
This is num0,then content is caimz
This is num1,then content is leco
This is num2,then content is icpc
This is num3,then content is zhuminjie
This is num4,then content is huzhipeng
This is num5,then content is lirunqing
This is num6,then content is chenle
This is num7,then content is chenhongzhi
This is num8,then content is jianglei
The array Length is: 9
---------------------

2、打印当前路径文件名





e3057c031f33b9bffbabe1185ba0ad76.png
2016-02-21 10:37 举报
已邀请:

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: