Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 exploiting the Monastery: (6)
As of 2014-12-20 02:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls