输入txt文件:
179819085:[email protected]:0179819085:548af13bdd5fc92c120491aef92f9a22:John:John:Pepa:1975-08-08:37:M:65:969:900563
输出txt文件:
[email protected]:548af13bdd5fc92c120491aef92f9a22
答案1
类似这样的:
echo 179819085:[email protected]:0179819085:548af13bdd5fc92c120491aef92f9a22:John:John:Pepa:1975-08-08:37:M:65:969:900563 \
| awk -F: '{print $2":"$4}'
[email protected]:548af13bdd5fc92c120491aef92f9a22
或者,有一个输入文件:
cat input.txt | awk -F: '{print $2":"$4}'