The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 02-09-2009
Gee-Money Gee-Money is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 48
you can use the sed "insert" comand:


Code:
the_prompt$ cat thefile

returns:


Code:
line1
line2
line3


Code:
the_prompt$ sed -e '1 i \the line you wanna put first' thefile

returns:


Code:
the line you wanna put first
line1
line2
line3