Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sed command, how to insert a newline 1

Status
Not open for further replies.

pho01

Programmer
Mar 17, 2003
218
US
In the $Statusfile, i want to replace XX-${UNIQUEID}-XX to Pending + new line. How do you insert a newline on this? (/"Pending"/)

cat ${STATUSFILE} | sed -e s/"XX-${UNIQUEID}-XX"/"Pending"/ > ${RUNDIR}/status.new

Thanks
 
try

cat ${STATUSFILE} | sed -e s/"XX-${UNIQUEID}-XX"/"Pending\n"/ > ${RUNDIR}/status.new

or
cat ${STATUSFILE} | sed -e s/"XX-${UNIQUEID}-XX"/"Pending^M"/ > ${RUNDIR}/status.new

to get the control M try control V then control M
 
Thanks bnothos!
\n doesn't work and i tried it before. ^M did. Cool!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top