Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Single line insert to the start of a file

by aaron_baugher (Deacon)
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.


Comment on Re: Single line insert to the start of a file
Download Code

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 cooling their heels in the Monastery: (7)
As of 2014-07-12 19:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (240 votes), past polls