-2

i should change on parameter to other from template file in linux.

sed -e "s/\${dir}/<in this place i should input path, like /home/username>/" /etc/nginx/site.conf

But it does not work. How to resolve it ? May be there are other ways, how to resolve it ? Thanks for your attention.

Piduna
  • 1
  • 3

1 Answers1

1

You did not tell us what error you got when executing this command. I can see that you are trying to replace some value with a file path containing slashes. You need to either escape the slashes \/ of file path or use another form of sed delimiters like this:

sed -e 's|\${dir}|/home/username>|' /etc/nginx/site.conf

Please, note that this command will not change the input file. It will show the modified output to stdout. Use -i option to update the file in-place or redirect output to another file.

Khaled
  • 36,533
  • 8
  • 72
  • 99