Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-09-2003, 08:44 PM   #1
LQ Newbie
Registered: Sep 2003
Posts: 4

Rep: Reputation: 0
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.
Old 11-09-2003, 08:50 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912
man cut
man awk

Read those and think again :)

Old 11-09-2003, 08:57 PM   #3
Registered: May 2003
Distribution: Slack Puppy Debian DSL--at the moment.
Posts: 341

Rep: Reputation: 30
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.

Last edited by Eqwatz; 11-09-2003 at 09:05 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
C editor MassiveBlood Linux - Software 3 10-16-2004 09:24 AM
Vi editor tmurray Linux - General 5 03-12-2004 11:33 PM
Question on the DCOP interface to KDE Advanced Text Editor (Kate) Laurene Linux - Newbie 0 02-25-2004 02:29 PM
vi editor question lpriyamb Linux - Software 4 09-23-2003 02:22 AM
Vi Editor BittaBrotha Linux - Software 1 02-09-2003 01:35 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:58 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration