Reputation: 27
I am doing bash scripting in RHEL7. I managed to do some simple if-else scripting, however, I now need to edit /etc/ssh/sshd_config file using bash script. I have to remove the '#' at protocol 2. Is there any way to do this? In addition I would like to add the Protocol 2 line in if it does not exist. I would appreciate any help given.
Upvotes: 0
Views: 590
Reputation: 3776
@Michel O beat me with sed -i
, but for more complex edits there is also ex
, which gives you the power of vi
from command lines.
Upvotes: 2