Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vi commands in a shell script 1

Status
Not open for further replies.

benp07

Technical User
Aug 31, 2001
87
0
0
US
i am trying to write a shell script that opens vi and then adds text to the file then only part that i don't know is how to get the vi command 'i' to work so i can insert text and how to i insert text just echo it

thanks
Ben
 
"vi" was originally written as a visual version of "ed" which will be more appropriate for scripting. Or better still, "sed" if you want to pipe in the files.
 
If all you want to append some lines to a file, this line should work:
Code:
echo "a line.." >> /path/to/file
echo "another line.." >> /path/to/file
//Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top