The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 -->
  #2 (permalink)  
Old 02-09-2009
quirkasaurus's Avatar
quirkasaurus quirkasaurus is offline
Registered User
  
 

Join Date: Jan 2009
Location: canton, michigan
Posts: 373
you mean on a file that's already there???

if the file in question isn't so huge it crashes vi, try this:

Code:

vi file << EOF
OWhatever you want as first line
^[:wq!
EOF
Where the ^[ is actually the ESCAPE character entered ( through vi ) with
CONTROL-V and ESC.