【发布时间】:2018-07-08 21:47:03
【问题描述】:
$ cat ansible/file | grep "Other users"
Other users
如何在我的 grep 之后的新行上添加新字符串?
$ cat ansible/file | grep "Other users"
Other users
NewString # New line with new string appended to file
【问题讨论】:
-
使用这个命令:cat ansible/file | grep "其他用户" | | awk '{print $0 "\nNewString"}'