我有一个这样的文件:
[profile.one]
username=sam
password=secret
email=something
[profile.two]
username=kate
password=secret
email=something
[profile.three]
username=mary
password=secret
email=something
我想创建一个shell脚本来更改
[profile.two]
中的密码。新密码将是一个变量(由另一个 shell 脚本触发)。例如,新密码将显示为 $1
。
我知道我应该使用 sed,但在那之后我很难弄清楚语法。