Skip to main content

How can I search and replace text that containcontains / with sed?

I currently use the following command which doesn't work

sed -i "s/queue_directory = /var/spool/postfix-secondary/queue_directory = /var/spool/postfix-$newnumber/g" /etc/postfix-$newnumber/main.cf

How can I search and replace text that contain / with sed?

I currently use the following which doesn't work

sed -i "s/queue_directory = /var/spool/postfix-secondary/queue_directory = /var/spool/postfix-$newnumber/g" /etc/postfix-$newnumber/main.cf

How can I search and replace text that contains / with sed?

I currently use the following command which doesn't work

sed -i "s/queue_directory = /var/spool/postfix-secondary/queue_directory = /var/spool/postfix-$newnumber/g" /etc/postfix-$newnumber/main.cf
Source Link
Teddy77
  • 3.2k
  • 8
  • 29
  • 34

sed - find and replace text containing "/"

How can I search and replace text that contain / with sed?

I currently use the following which doesn't work

sed -i "s/queue_directory = /var/spool/postfix-secondary/queue_directory = /var/spool/postfix-$newnumber/g" /etc/postfix-$newnumber/main.cf