^M

Brad De Vries devriesbj
Mon May 17 11:46:57 PDT 2004


--- Ted Ozolins <ted at telus.net> wrote:
> During my days working with cp/m I use to use in
> scripts ^M to obtain 
> the action of <Enter>. How or what can be used in
> bash (as in rc.local) 
> to get the same action?
> TIA
> 
> Ted Ozolins (VE7TVO)
> Westbank, B.C.

Ted, here are a couple of options for you:
1) echo -e "Hello\nWorld"
Will produce:
Hello
World

Try "man echo" for additional escape-characters like
"\n".

2) If you want a <CTRL>-M in a file/script/etc.  Try
using vi and while in input mode, press <CTRL>-V
immediately before the <CTRL>-M.  This will insert a
^M into the file.
I.e., if a script contains:
  echo "1234^Mab"
it will produce:
ab34

HTH,
Brad.

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com


More information about the Linux-users mailing list