一串数字的切割!

[quote:0c004e80d1="zhy2111314"]看看这个行不
[code:1]echo "02150987980"|sed '/.../&\ /'|awk '{print $1}'[/code:1][/quote]

[code:1]echo "02150987980" | sed 's/.../&\ /' | awk '{print $1}'[/code:1]


这样就行了! :D
要包括4位的区号才通用
那去掉後面8位呢?
[code:1]
echo "02150987980" | sed 's/.\{8\}$//'
[/code:1]
试试正则表达式
echo "02159987980" |grep [0-9]\{4\}
这个不行,楼主要分割,没看清楚