Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Single line insert to the start of a file

by aaron_baugher (Curate)
on Aug 16, 2012 at 09:57 UTC ( #987724=note: print w/ replies, xml ) Need Help??


in reply to Single line insert to the start of a file

Assuming a *nix system, and the existence of a real-world problem to be solved rather than a homework problem in a particular language:

head -1 file1 >/tmp/file.$$; cat file2 >>/tmp/file.$$; mv /tmp/file.$$ file2

Aaron B.
Available for small or large Perl jobs; see my home node.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://987724]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2016-07-25 15:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (224 votes). Check out past polls.