The UNIX Forums
"Join the Network of UNIX System Users"


 
Subject: append to fle using sed
CYBERAY
Newbie
Rank: 1



UID 102
Digest Posts 0
Credits 0
Posts 73
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 20, 2007 10:17 AM  Profile | P.M. 
append to fle using sed



append to fle using sed



hello ,

i have the folloiwing command :
sed -n "$var,$final w $destfile" $sourcefile

where :
$var - $final represent the range of line numbers to be written in $destfile


however i require this command to work in a loop for which i need the sed command to keep appending the output to the $destfile .

any help ??
thanks in advance ,


Top
alarik
Newbie
Rank: 1



UID 46
Digest Posts 0
Credits 0
Posts 48
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 20, 2007 10:17 AM  Profile | P.M. 
sd,
"sed" overwrites the file in the "w" option every time it runs.
if you want to continue appending to the file, you can try
this alternate "sed" solution:

code:

rm -f ${sourcefile}
Top
 

 

All times are GMT, the time now is Jul 31, 2010 03:28 AM

Powered by Discuz! 5.0.0  © 2001-2006 UNIX Forums
Processed in 0.004700 second(s), 8 queries

Clear Cookies - Contact Us - UNIX Help - Archiver - WAP