Register
It is currently Sun Apr 20, 2014 1:14 pm

Cut the content of a file (f1 for example) into another file


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Thu Oct 11, 2007 4:12 am   

Joined: Thu Oct 11, 2007 4:08 am
Posts: 2
i need a shell script that cuts the content of a file and paste it into another file(this file must have the write permission granted).


Top
 Profile  
 PostPosted: Thu Oct 11, 2007 7:24 am   
Moderator
User avatar

Joined: Thu Oct 11, 2007 7:12 am
Posts: 224
Location: London - UK
Florinel50 wrote:
i need a shell script that cuts the content of a file and paste it into another file(this file must have the write permission granted).


There is not enough detail here, to merge 2 text files...

cat file >> otherfile


Top
 Profile  
 PostPosted: Thu Oct 11, 2007 2:56 pm   
User avatar

Joined: Tue Oct 02, 2007 9:22 pm
Posts: 11
Location: Argentina
I've been looking a bit. This maybe doesn't is the best solution, but a think that you can at least copy a content and paste it at the final of other archive with sed and pipes.

Code:
sed -n '/[Here you put the opening pattern]/,/[Here the closing pattern]/p' archivecopy >> archivepaste


That will copy the output, wich is everything between the patterns you choosed, from the archivecopy to the end of the archivepaste.
Hope it helps.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP