LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   vi editor wc question (https://www.linuxquestions.org/questions/linux-newbie-8/vi-editor-wc-question-114236/)

maelstrombob 11-09-2003 07:44 PM

vi editor wc question
 
Ok I'll be to the point. I am putting together a simple vi file. In my executable file, I have a clear command follwed by several stanzas of a poem. So when executed, the screen will clear and display what I have typed in that file. After the poem, though, I would like to end the file with a wc. The catch is that I would like to end the file with text and a wc (for example: "This document contains __ words."
"This document contains __ lines."
"This document contains __ characters."
The blank is where I would like to have the resulting number from the wc to display. I cannot get the wc to execute so that it does not display the source filename afterwards.

If anyone knows a way I can do this, I would appreciate the info.
Maelstrombob

Tinkster 11-09-2003 07:50 PM

man cut
man awk


Read those and think again :)

Cheers,
Tink

Eqwatz 11-09-2003 07:57 PM

Do you mean you are putting together a simple bash-script involving the use of vi? I could do it as a shell script--but I'm kind of lost as to why you are doing the whole thing with vi.

You could call it something else and alias vi if you wanted it to run everytime you ran vi.

Or, if you are more familiar with "C" programming you could make it a "C-shell" script.

------------------------------------------
A guru is s-o-o-o much more than that. I've read a lot of Docs, and I'm mainly confused. An Admin. reads the Docs. A guru contributes Docs, and writes entries for send-mail configuration from the command-line; a god contributes stuff (accepted by Linus) to the source.


All times are GMT -5. The time now is 05:10 AM.