Alex Rivera | Logout

Find and replace in shell scripting

Asked 2012-06-01T20:12:25.370
18

Is it possible to search in a file using shell and then replace a value? When I install a service I would like to be able to search out a variable in a config file and then replace/insert my own settings in that value.

Edit
Report

1 Answer

0

Generally a tool like awk or sed are used for this.

$ sed -i 's/ugly/beautiful/g' /home/bruno/old-friends/sue.txt
answered 2012-06-01T20:17:19.007

Your Answer