[CentOS] sed question
Larry Martell
larry.martell at gmail.comTue Aug 25 17:54:58 UTC 2015
- Previous message: [CentOS] sed question
- Next message: [CentOS] sed question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, Aug 25, 2015 at 1:50 PM, Jerry Geis <geisj at pagestation.com> wrote: > I am trying to use sed to change a value in a pipe. > > ------------------- This is the two line script > CHANGE="1234" > > cat my_file.txt | sed 's/CANCELID/$CHANGE/' > cancel.txt > ------------------- > > and the my_file.txt has: > <v1:notificationId>CANCELID</v1:notificationId> > > it gets changed to $CHANGE instead of the actual value 1234 . > I tried putting a \ in front of the $ also and made no difference. > > What am I not doing correctly. You need to use double quotes: cat my_file.txt | sed "s/CANCELID/$CHANGE/" > cancel.txt
- Previous message: [CentOS] sed question
- Next message: [CentOS] sed question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list