Answers:
这是一个awk
解决方案:
$ awk '$0=$1" "$1*$2' input.txt
1 677679866
2 243735232
3 148239594
4 161663928
但是您可以通过多种方式来实现,这是一种perl
解决方案:
$ perl -ape 's/$F[1]/$F[0]*$F[1]/e' input.txt
1 677679866
2 243735232
3 148239594
4 161663928
您可以使用-i
选项进行更改:
$ perl -i.bak -ape 's/$F[1]/$F[0]*$F[1]/e' input.txt