Has anyone created a script that will issue vi commands on a file? For example, I've written a script that redirects the output from a command to a log file, I now need to open this log file and edit with vi; add some explainations about what the log file says before returning it back to the screen.
I suspect you do not want to use vi for this purpose (and I'm not sure you can, even if you wanted to). Instead, consider using ed (precursor to vi, and still available from within vi). The ed command allows you to edit a file in place; you can use a "here document" within a shell script to perform the editing, which automates the process.
Hope this helps.
__________________ The slowest component still sits at the keyboard.
THIS THREAD HAS EXPIRED.
Are you having the same problem?
We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.