[TUHS] run commands at login in v6 and stty

Michael Kjörling michael at kjorling.se
Sun Feb 27 07:03:09 AEST 2022


On 26 Feb 2022 14:39 -0600, from will.senn at gmail.com (Will Senn):
> I'm sure it's simple, but I can't figure it out. How do I get something to
> run at login in v6?

>From a very quick perusal of
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/source/s2/sh.c it
doesn't look like you can, at least not in the way we're used to today
of having the shell execute a magic file (such as ~/.bashrc) during
startup. I also don't see anything in
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/etc/passwd that
suggests that the shell can be specified on a per-user basis the way
we're used to being able to do today, so the hack of making that point
to a program that does some initial setup and then launches the shell
proper also might not be readily available.

On the other hand,
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh/main.c
looks like it includes such support; see the section surrounding the
pathopen(nullstr, profile) call toward the bottom of main(). (Beware:
it's written in Bourne C.)

I won't say "you can't do it in V6", because I don't know things
anywhere near well enough to say that, but it doesn't look entirely
trivial at least, and it seems to have been added in V7's sh.

-- 
Michael Kjörling • https://michael.kjorling.semichael at kjorling.se
 “Remember when, on the Internet, nobody cared that you were a dog?”



More information about the TUHS mailing list