Why shouldn't ^J (linefeed) be used as a command in an application?

Doug Gwyn gwyn at smoke.BRL.MIL
Wed Dec 14 17:03:58 AEST 1988


In article <4404 at sfsup.UUCP> gill at sfsup.UUCP (Timothy D. Gill) writes:
>we want to change it because of a conflict with the use of ^Z for 
>the SUSPEND line discipline character for BSD-style job control.  

Note that you can disable or change that special character in the
new-tty handler, permitting its continued use in your application.

>Our only choices are ^C and ^J because all other control characters 
>are used by the tool already.

Ouch.  What are you going to do when you need to add another
function?  This might be a good time to figure that out.

>What are the historical or cultural reasons that ^J is not used in UNIX
>tools?  Is there a strong reason not to use it now?

^J (ASCII LF) is, of course, the character UNIX uses in text files
and streams to denote "new line".  Depending on the terminal handler
modes, a received CR may be mapped into LF (also there are some
options concerning how CR and LF are echoed).

Some terminals don't have CR, just NL (same code as LF).



More information about the Comp.unix.questions mailing list