The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 02-03-2008
digobh digobh is offline
Registered User
 

Join Date: Jan 2008
Posts: 3
Hi Franklin,

Thanks for your attention.

this is the code

# Changing the Strings
sed -e s/INICIO/$startframe/g \
-e s/FIM/$endframe/g \
-e s/TEMPOINICIAL/$TEMPO1/g \
-e s/TEMPOFINAL/$TEMPO2/g \
-e s/epXXX/ep${EP}/g \
-e s/scXXX/sc${SC}/g \
-e s/shXXX/sh${SH}/g \
-e s/NAME/${i}/g < ${tmpFolder}filesin_line.txt > ${tmpFolder}filesin_line1.txt
sed '$ r' '${tmpFolder}filesin_line1.txt'' < ${tmpFolder}filesin_line1.txt > ${tmpFolder}filesin_lineNEW.txt
rm ${tmpFolder}filesin_line1.txt
done
exit

-------
filesin_line.txt ( this is the first file that has to be inserted into the next one (filesin_lineNEW.txt ))

I don't know if I'm explaining right. But when the looping happens, sed can't overwrite the file (filesin_lineNEW.txt) and I don't know what do it to make sed add the previous modified file.

Please let me know if explanining well...sorry.
Thanks
Reply With Quote