- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Vi Editor !!!!!
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2006 10:11 AM
02-24-2006 10:11 AM
Vi Editor !!!!!
I gotta some wkrs with vi..Cud somebody throw some lights on "searching a WORD and deleting the line containing that word"...
Any links/stuff whers I can understand more tricks with good examples..
Thxs n advance,
Just-In
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2006 10:19 AM
02-24-2006 10:19 AM
Re: Vi Editor !!!!!
http://www.lagmonster.org/docs/vi.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2006 10:25 AM
02-24-2006 10:25 AM
Re: Vi Editor !!!!!
But I suspect you want more? Like all lines in the file that match? Or like put the whole think in a script?
I would suggest the sed editor for that job instead of vi. Is is more script oriented imho.
But why not simply use:
$ grep -v WORD file-with-word > file-without-word.
Again, add -E or wordboundaies as needed
If GREP can not do the job, then please explain why not. Know that, someone may be able to resolve it, or may be able to come up with a better vi or sed solution based on a refined problem description.
fwiw,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2006 10:28 AM
02-24-2006 10:28 AM
Re: Vi Editor !!!!!
Here's a brief, basic introduction to using 'vi':
http://docs.hp.com/en/A2615-90003/ch17.html
Of course, the standard first-line-of-defense cam always be found in the manpages:
http://www.docs.hp.com/en/B2355-60103/vi.1.html
For your question:
:/word
dw
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2006 02:10 PM
02-24-2006 02:10 PM
Re: Vi Editor !!!!!
For searching a word in vi, Go to command mode
/word
Curser will on the word. You can delete the entire line by 'dd'(without quote)
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2006 02:12 PM
02-24-2006 02:12 PM
Re: Vi Editor !!!!!
As always, take a look at "man vi" for complete listing of commands and this link should be helpful...
http://www.chem.brown.edu/instructions/vi.html
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2006 01:09 AM
02-25-2006 01:09 AM
Re: Vi Editor !!!!!
I am mystified as to why you (and some other individuals) post the same answers hours or days after other participants. I am mystified why your posts are divided into multiple ones usually minutes apart.
Please read what has alraedy been written in a post and think a little before you write. We need fresh information, not a "me too".
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2006 03:03 AM
02-25-2006 03:03 AM
Re: Vi Editor !!!!!
I am mystified as to why you (and some other individuals) post the same answers hours or days after other participants. I am mystified why your posts are divided into multiple ones usually minutes apart.
*** My long posts are not getting into forums.. Thats why i prefer short answers. When i post long answers, i always get Error posting message. May be i need to change my browser from Firefox.. Even, Muthukumar has this problem from his machine.
Please read what has alraedy been written in a post and think a little before you write. We need fresh information, not a "me too".
***I gave a fresh information that defers from what others gave (I used "dd" to delete where your was "dw").
Thanks,
Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2006 07:14 AM
02-25-2006 07:14 AM
Re: Vi Editor !!!!!
"... I am mystified as to why you (and some other individuals) post the same answers hours or days after other participants ..."
Ditto.
It ads no value and it distracts.
Myself, and other also I suspect, keep following topics where we opted to reply. So when a good time later a redundant reply is added then not only that reply time is wasted, but my time is also wasted.
I have the same problem with replies only suggesting to add points.
I know, it is entirely my own choice to re-visit, but still...
>>> *** My long posts are not getting into forums..
I beg to differ. You may well be correct, but I suspect it was just the general reply trouble we all went through a while ago. Just wait and the replies would be there, and keep a backup copy handy just in case.
>> change my browser from Firefox..
I tend to use firefox. No problem for me.
>> ***I gave a fresh information that defers from what others gave (I used "dd" to delete where your was "dw").
fwiw: My reply mentioned dd hours earlier.
'nuff said.
I am looking forward to many more great replies from all, just less noise if you could please!
Kindest regards,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2006 07:50 AM
02-25-2006 07:50 AM
Re: Vi Editor !!!!!
You will find 2 camps - Those who like vi and those who don't.
Here's a good page for you full of tip and tricks for beginners"
http://www.csci.csusb.edu/dick/samples/vi.notes.html
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2006 09:20 PM
02-26-2006 09:20 PM
Re: Vi Editor !!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2006 01:04 AM
02-27-2006 01:04 AM
Re: Vi Editor !!!!!
esc
/STRING
to search for the same string hit the "/"
again..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2006 02:28 AM
02-27-2006 02:28 AM
Re: Vi Editor !!!!!
The : puts you in ed mode,
g/WORD/d
means: globally, search for WORD, and delete the line(s) it is found on