首页 > 解决方案 > 执行bash命令后如何减少或隐藏特定的行输出?

问题描述

例如,我使用参数运行命令

# ./nonmyprogram 

它会打印出一些有用的信息和秘密

Your ID: 1234
Secret ID: qwerty
Some other: data

我想添加一些输出转换,所以我会得到:

Your ID: 1234
Some other: data

或者

Your ID: 1234
Secret ID: [redacted]
Some other: data

标签: bashshell

解决方案


推荐阅读