A
A
Alexander Semenenko2019-11-12 16:55:28
linux
Alexander Semenenko, 2019-11-12 16:55:28

How to add options to the config using commands, without manual editing in nano?

There is a samba config. I need to find all lines starting with write list and valid users, add a comma and username to the end of the line. How can I do that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2019-11-12
@semenenko88

sed -r "s/^(write list.*|valid user.*)/\1,user/" <samba.config>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question