Solved

append one file at the end of another

Posted on 2008-10-19
5
721 Views
Last Modified: 2013-12-26
How do I append one file at the end of another file using sed command?
0
Comment
Question by:saibsk
  • 3
5 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 22754337
Why sed?

Why not just

cat file1 >>file2

0
 
LVL 48

Expert Comment

by:Tintin
ID: 22754345
If you really did want to use sed, you can do

sed 'n' file1 >>file2
0
 

Author Comment

by:saibsk
ID: 22754502
what is the n option in sed Please advise.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 22754560
From memory it means "next line"
0
 
LVL 40

Accepted Solution

by:
omarfarid earned 500 total points
ID: 22754801
try

sed '$r file2' <file1>file3

here $ will take sed to the end of the input file file1 and then read file file2 and result will be stored in the new file file3
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now