There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
UNIX/Linux
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > UNIX/Linux >
VI editor help


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
prepare's Avatar
Junior Member with 1 posts.
 
Join Date: Mar 2004
14-Mar-2004, 07:10 PM #1
VI editor help
Hi guys,

im trying to learn how to use Linux and the VI editor. I have book im trying to go through doing practice questions etc to learn commands but im stuck on a few

one of the questions is
I want to search for the character ^M (RETURN) just before the end of any line how do i search for this? and how could i delete all such patterns in your vi buffer with one global replace command?

and How would I go about changing all instances of multiple consecutive spaces to a single space?

any help would be appreciated,

thanks

Andrew
Squashman's Avatar
Distinguished Member with 12,590 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
16-Mar-2004, 10:05 AM #2
I know how to do it using SED or TR but not sure how to do it within VI.

I thought the ^ meant the beginning of a line and the $ was the end of a line.

If you want to search for something you need to be in command mode first. So hit the esc key twice for good measure. Then type /^
__________________
I hate asking the same question twice!
How to ask questions the smart way!
Microsoft MVP - Windows Shell/User
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:36 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.