[NBLUG/talk] changeing line breaks.

E Frank Ball frankb at efball.com
Sun Oct 19 21:47:00 PDT 2003


On Sun, Oct 19, 2003 at 09:30:36PM -0700, Ron Wickersham wrote:
} > }
} > } in going the other way, editing a dos file in vi and keeping it in unix,
} > } you can do :%s/
} > } //g and get rid of all the extra carriage returns.
} > } (you get the
} > }  above with <cont>V followed by <return>).
} >
} > What will be visable at the : prompt is this:
} >
} > :%s/^M//g
} >
} > Where ^M is <ctrl><Enter>, which is made with
} > <ctrl>v <ctrl><Enter>
} 
} interesting, it looked ok on a dtterm when i typed it but obviously sent
} the x0D in the mail.   i've found that <ctrl>V  is designed to take the next
} keystroke as a control character without using the <ctrl> key at the same
} time.

I learn something new everyday.  I've always held down the <ctrl> key
for the 2nd character, but you are correct - that is unnecessary.



} i got wondering if <ctrl>V has anything to do with vi or if the shell
} is doing the work.  on a couple of different systems i found that sh and
} csh both showed the ^ when you type <ctrl>V and the second <ctrl> is not
} required, but bash didn't show anything when typing <ctrl>V but then
} after typing the second character, then showed both characters.

In tcsh I'm getting a ^J from <ctrl>v <enter>, but bash gives ^M, just
like vim.  I know it doesn't do anything in many editors, so I'm
assuming it's built into vi.


 
} to further confuse things i've always seen the typographic convention that
} <ctrl> is followed by the upper-case version of the key hit while the <ctrl>
} key is down and doesn't imply that the shift key is also pressed.  i guess
} it's because there aren't any keys with the lower case glyphs printed on
} them.  Frank's use of the lower case makes sense but looks unusual to
} me.  does HP documentation use the lower case or am i out of it and
} things have changed so that either case is used in documentation?


You are correct, control characters are always expressed as capitols,
but the <shift> key is not necessary.  I deliberately showed it as lower
case because I was trying to show the key sequence needed ^v to create
the desired control character, not the resulting character ^M itself.


-- 

   E Frank Ball                frankb at efball.com



More information about the talk mailing list