Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 awk 从 100 中减去一列。我努力了
awk '{ t = 100-$2 } END { print t }' /alps/average.log
它只给了我减去的最后一个值。如果我想在终端上输出整列,如何实现?
尝试这个:
awk '{print 100-$2}' /alps/average.log
标签后的命令END仅在文件结束后执行。
END
print t在未标记的块中,绝对不是在标记的块中END!
print t