Subject: Re: any way to test what virtual console are logging in from?
To: None <netbsd-help@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: netbsd-help
Date: 12/06/2000 02:41:30
In article <20001205205521.A220@antioche.eu.org>,
Manuel Bouyer <bouyer@antioche.lip6.fr> wrote:
>On Tue, Dec 05, 2000 at 10:10:45AM +0900, Henry Nelson wrote:
>> I use /bin/csh, and I'd like some way to switch between what settings
>> are in .login depending on what virtual console (ttyv0, ttyv1 or ttyv2)
>> I log in from.  Specifically, I am interested in changing stty settings.
>> Does anyone know how to write an if statement to do this?  TIA.
>
>Something like:
>if (`tty` == "/dev/ttyE0") then
><ttyE0 stuff>
>endif
>
>should work.

4.4BSD csh sets $tty if it is attached to one; if you want to be
more portable, you can run `tty` but use "`tty`" otherwise it will
not work for non-interactive shells.

christos