Re: sed question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



----- Original Message -----
| 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.
| 
| Thanks,
| 
| jerry

Single quotes = literal.  Double quotes = interpreted

;)

-- 
James A. Peltier
IT Services - Research Computing Group
Simon Fraser University - Burnaby Campus
Phone   : 604-365-6432
Fax     : 778-782-3045
E-Mail  : jpeltier@xxxxxx
Website : http://www.sfu.ca/itservices
Twitter : @sfu_rcg
Powering Engagement Through Technology
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux