- cat a
- a:b:c:d:e:f:g:h:i
使用awk将该字符串冒号两边的段输出
cat a |awk -F':' '{split($0,arr,":")}END{for(i=1;i<=NF;i++)printf("%s\n",arr[i])}'
输出结果如下 - a
- b
- c
- d
- e
- f
- g
- h
- i
5063阅读 9评论2011-09-27 caojiangfeng
分类:Python/Ruby
python中也有这个函数
<div class="quote"><span class="q"><b>随1意2o</b>: python中也有这个函数.....</span></div>对啊
<div class="quote"><span class="q"><b>caojiangfeng</b>: 对啊.....</span></div>你个瓜怂
<div class="quote"><span class="q"><b>caojiangfeng</b>: 对啊.....</span></div>你个瓜怂
<div class="quote"><span class="q"><b>caojiangfeng</b>: 对啊.....</span></div>你个瓜怂
<div class="quote"><span class="q"><b>caojiangfeng</b>: 对啊.....</span></div>你个瓜怂<img src="/image/face/30.gif" >
<div class="quote"><span class="q"><b>caojiangfeng</b>: 对啊.....</span></div>你个瓜怂<img src="/image/face/30.gif" >
<div class="quote"><span class="q"><b>caojiangfeng</b>: 对啊.....</span></div>你个瓜怂<img src="/image/face/30.gif" >
<div class="quote"><span class="q"><b>caojiangfeng</b>: 对啊.....</span></div>你个瓜怂<img src="/image/face/30.gif" >