1
IgniteWhite 2021-08-02 23:21:16 +08:00
你要学的是 regex,然后在 sed/awk 里用
|
2
Atomo 2021-08-03 23:31:07 +08:00 via Android
|
3
Atomo 2021-08-04 01:23:21 +08:00 via Android
|
4
kaiger 2021-08-04 18:08:47 +08:00
echo “2001:db80::a00:27ff:fe67:cd9c” | awk -F ':' '{print $1":"$2"::"$4}'
输出:2001:db80::a00 |
5
s5unty 2021-08-05 14:39:31 +08:00
```
% echo "2001:db80::a00:27ff:fe67:cd9c" | cut -d':' -f-4 2001:db80::a00 % echo "2001:db80::a00:27ff:fe67:cd9c" | cut -d':' -f4- a00:27ff:fe67:cd9c ``` |
6
826540272 OP 已经解决了,用 cut -d: -f1-4
很简单 |