【发布时间】:2014-09-21 00:01:19
【问题描述】:
我有一个带参数的文件
testArgument=
它可能有相同的东西或什么都没有,但我想评论它并使用提供的信息添加新行
之前:
testArgument=Something
结果:
#testVariable=Something
#Comments to let the user know of why the change
testVariable=NewSomething
我应该循环它还是应该使用sed 之类的东西?我需要它兼容 Ubuntu 和 Debian 以及 bash。
【问题讨论】: