rnelson@eecs.wsu.edu (Roger Nelson - Grad Student) (12/07/90)
------ How to you stty a terminal line that you are not currently connected to. Specifically I have written a small C shell script that prints to a local printer connected to a terminal (even if you are not logged in with that terminal). This works fine (NL is mapped to CR LF) as long as someone is logged in with the terminal. When no one is logged in with the terminal, NL is only mapped to LF. So what I would like to do is specify the device, something like: stty -d ttyd4 onlcr Is there a way? _____________________________________________________________________ ______________ ____ | ^ | Roger Nelson rnelson@yoda.eecs.wsu.edu \^^ |*| ^ | Agricultural Engineering Department /// |^^// ^^ | Computer Science Department /// | ' ^ +| Washington State University \\\/// \_ ^ _________| Pullman, WA 99164 \XX/ `-----'
subbarao@phoenix.Princeton.EDU (Kartik Subbarao) (12/07/90)
In article <1990Dec07.055142.11132@eecs.wsu.edu> rnelson@yoda.UUCP (Roger Nelson) writes: >------ > >How to you stty a terminal line that you are not currently connected to. > >Specifically I have written a small C shell script that prints to a local >printer connected to a terminal (even if you are not logged in with that >terminal). This works fine (NL is mapped to CR LF) as long as someone is >logged in with the terminal. When no one is logged in with the terminal, >NL is only mapped to LF. > >So what I would like to do is specify the device, something like: > > stty -d ttyd4 onlcr > >Is there a way? Yes. Either stty onlcr < /dev/ttyd4, stty onclr > /dev/ttyd4 ( I'm not sure which one. ) Or just open /dev/ttyd4, load in the struct sgttyb (or termio for SunOS), diddle the right flags, and then issue the appropriate ioctl(). -Kartik -- (I need a new .signature -- any suggestions?) subbarao@{phoenix or gauguin}.Princeton.EDU -|Internet kartik@silvertone.Princeton.EDU (NeXT mail) -| SUBBARAO@PUCC.BITNET - Bitnet
thomas@uppsala.telesoft.se (Thomas Tornblom) (12/07/90)
In article <1990Dec07.055142.11132@eecs.wsu.edu> rnelson@eecs.wsu.edu (Roger Nelson - Grad Student) writes:
How to you stty a terminal line that you are not currently connected to.
So what I would like to do is specify the device, something like:
stty -d ttyd4 onlcr
Is there a way?
Try:
stty onlcr < /dev/ttyd4
--
Real life: Thomas Tornblom Email: thomas@uppsala.telesoft.se
Snail mail: Telesoft Uppsala AB Phone: +46 18 189406
Box 1218 Fax: +46 18 132039
S - 751 42 Uppsala, Sweden
dns@essnj1.ESSNJAY.COM (David N. Sears) (12/08/90)
In <1990Dec07.055142.11132@eecs.wsu.edu> rnelson@eecs.wsu.edu (Roger Nelson - Grad Student) writes: >------ >How to you stty a terminal line that you are not currently connected to. >Specifically I have written a small C shell script that prints to a local >printer connected to a terminal (even if you are not logged in with that >terminal). This works fine (NL is mapped to CR LF) as long as someone is >logged in with the terminal. When no one is logged in with the terminal, >NL is only mapped to LF. >So what I would like to do is specify the device, something like: > stty -d ttyd4 onlcr Yep -- to do what you want type stty onlcr </dev/ttyd4 You must use the full path name because the shell has to do the open for stty. David Sears EssnJay Systems, Inc. Huntington, CT
mercer@npdiss1.StPaul.NCR.COM (Dan Mercer) (12/11/90)
In article <1990Dec07.055142.11132@eecs.wsu.edu> rnelson@yoda.UUCP (Roger Nelson) writes:
:------
:
:How to you stty a terminal line that you are not currently connected to.
:
:{stuff deleted]
:
:So what I would like to do is specify the device, something like:
:
: stty -d ttyd4 onlcr
:
:Is there a way?
:
stty acts upon stdin - thus 'stty onlcr </dev/ttyd4' will be correct.
However, you must have permissions set up correctly to allow this.
--
Dan Mercer
NCR Network Products Division - Network Integration Services
Reply-To: mercer@npdiss1.StPaul.NCR.COM (Dan Mercer)
"MAN - the only one word oxymoron in the English Language"
guy@auspex.auspex.com (Guy Harris) (12/15/90)
>Yes. Either stty onlcr < /dev/ttyd4, stty onclr > /dev/ttyd4 > >( I'm not sure which one. ) Given that he didn't say what flavor of UNIX he was running, nobody else is sure, either; V7 and BSD-flavored versions of "stty" use the latter (they act on the standard output), and S5-flavored versions use the former (they act on the standard input). Note that the flavor here has nothing to do with whether the tty driver's "ioctl()" interface is V7/BSD-flavored or S5-flavored; SunOS 4.x's tty driver's fundamental interface is an S5 superset (although there's a streams module to translate V7/BSD "ioctl()"s into S5-superset "ioctl()"s), but it has a V7/BSD-flavored "stty" in "/usr/bin" and an S5-flavored one in "/usr/5bin". While "onlcr" is an S5-flavored mode, he could be running SunOS 4.x and the BSD-flavored "stty" in "/usr/bin". >Or just open /dev/ttyd4, load in the struct sgttyb (or termio for SunOS), More correctly, "termio" or "termios" for systems with more modern tty drivers, including System V ("termio" prior to R4, either one for R4), SunOS 4.x (either one), or 4.4BSD ("termios"), and "sgttyb" for systems with older tty drivers, including BSD prior to 4.4, SunOS prior to 4.0, etc.. (Some systems, such as SunOS 4.x and S5R4, support both.)
friedl@mtndew.Tustin.CA.US (Stephen J. Friedl) (12/16/90)
Dan Mercer writes: > stty acts upon stdin - thus 'stty onlcr < /dev/ttyd4' will be correct. > However, you must have permissions set up correctly to allow this. You can always do this the sneaky way: $ stty whatever 3>/dev/ttyd4 0<&3 The 3>/dev/ttyd4 gives you a writable descriptor to the terminal and then the 0<&3 redirects input from that place. You do not require read permission on the device being set (on System V, at least). Also note that older versions of BSD (4.1?) did stty on their stdout. Steve -- Stephen J. Friedl, KA8CMY / 3B2-kind-of-guy / Tustin, CA / 3B2-kind-of-guy +1 714 544 6561 / friedl@mtndew.Tustin.CA.US / {uunet,attmail}!mtndew!friedl "If it doesn't core dump, ship it" - Gary W. Keefe, on product development
jeff@onion.pdx.com (Jeff Beadles) (12/16/90)
mercer@npdiss1.StPaul.NCR.COM (Dan Mercer) writes: >stty acts upon stdin - thus 'stty onlcr </dev/ttyd4' will be correct. ^^^^^ >However, you must have permissions set up correctly to allow this. BEEP. Wrong answer, for a lot of Unix systems. This is the System V answer to the question. For BSD however, stty acts on stdout, and this is useless. (onclr is a SysV'ism though, so this is correct for his specific request, but not a general solution/answer.) -Jeff -- Jeff Beadles jeff@onion.pdx.com