作者mathfeel (mathfeel)
看板Linux
標題Re: [問題] 請教shellscript parse [ 1, 2 ] 中數字
時間Sat Oct 22 19:34:51 2011
※ 引述《guessi (沒)》之銘言:
: echo "x [ 12, 34 ]"|sed 's/[^0-9]/ /g'|awk '{print$1==$2?"equal":"not equal"}'
echo "asdfwer [ 1234, 3456 ]" | sed 's:[^0-9]*\([0-9]*\)[^0-9]*\([0-9]*\)[^0-9]*:\1 -eq \2:' | xargs test || echo 'not eq'
--
In heaven, all the interesting people are missing.
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 108.66.116.155
→ firejox:我都忘了有test這好東西了...Orz 10/23 18:25
推 ptthidebear:感謝大大 最近沒啥時間測試東西Orz 晚點來試試看!!! 10/24 08:11