LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-09-2003, 07:44 PM   #1
maelstrombob
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.
Maelstrombob
 
Old 11-09-2003, 07:50 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
man cut
man awk


Read those and think again :)

Cheers,
Tink
 
Old 11-09-2003, 07:57 PM   #3
Eqwatz
Member
 
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 08:05 PM.
 
  


Reply


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 08:24 AM
Vi editor tmurray Linux - General 5 03-12-2004 10:33 PM
Question on the DCOP interface to KDE Advanced Text Editor (Kate) Laurene Linux - Newbie 0 02-25-2004 01:29 PM
vi editor question lpriyamb Linux - Software 4 09-23-2003 01:22 AM
Vi Editor BittaBrotha Linux - Software 1 02-09-2003 12:35 PM


All times are GMT -5. The time now is 07:24 AM.

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