1
vote
1answer
138 views

Change a value in a config file, or add the setting if it doesn't exist?

When modifying config files from the command line, I often want to find the setting in the config file and modify that line if that setting exists. If that setting doesn't exist, I want to add it to ...
5
votes
4answers
148 views

Clean way to temporarily replace a config file?

I use a drawing program called Inkscape, which has both a GUI and a command line interface. When used on the command line, it has a large number of options that can only be controlled through a ...
4
votes
1answer
503 views

How to set firefox homepage from terminal?

I am trying to configure firefox from a script. I have already hit a wall establishing the deafault homepage. Found some old info what does not work anymore: echo ...
3
votes
3answers
272 views

How to make and apply (patch) one side diff?

I want to make a shell script that updates a config file. The file present on the server has information, like various IP addresses. The new file has more code, from new configs added to the system, ...
0
votes
3answers
489 views

wrapper command for sshd_config?

Is there a command to set settings in sshd_config, instead of manually editing the file? I would prefer it to do this way, because it's easier to automate. Otherwise I'd have to grep config with my ...
3
votes
1answer
627 views

Change screen “hardstatus” color dynamically

I show the hard-disk free space in hardstatus screen. But also I want change the color of this value when it's less than a value to alert me. I have done a script that it checks this and it returns a ...
5
votes
1answer
2k views

Replacing multiple lines in sed or awk

I'm trying to use sed or awk to replace 5 lines in a smb file but I just don't have any idea how to deal with the newlines.