The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* Re: [TUHS] run commands at login in v6 and stty
@ 2022-02-28  1:04 Douglas McIlroy
  2022-02-28  7:22 ` Rob Pike
  2022-02-28 18:18 ` Warner Losh
  0 siblings, 2 replies; 20+ messages in thread
From: Douglas McIlroy @ 2022-02-28  1:04 UTC (permalink / raw)
  To: TUHS main list

> The X11 tree was a heavily ifdef-ed.  And it needed to be, I don't have
> an answer as to how you would reuse all that code on different hardware
> in a better way.

Plan 9 did it with #include. The name of the included file was the same for
every architecture. Only the search path for include files changed. Done with
care, this eliminates the typical upfront #ifdefs.that define constants and set
flags.

Other preprocessor conditionals can usually be replaced by a regular if, letting
the compiler optimize away the unwanted alternative. This makes conditionals
obey the scope rules of C.

Doug

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: [TUHS] run commands at login in v6 and stty
@ 2022-02-27  7:48 Noel Chiappa
  0 siblings, 0 replies; 20+ messages in thread
From: Noel Chiappa @ 2022-02-27  7:48 UTC (permalink / raw)
  To: tuhs; +Cc: jnc

   > From: Clem Cole

   > what I don't remember was it in v5

Your memory is going! :-) We discussed this recently (well, recently in _our_
timescale :-); it's built into in 'cc' in V5:

  https://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s1/cc.c

see "expand(file)".

	Noel

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: [TUHS] run commands at login in v6 and stty
@ 2022-02-26 21:45 Brian Walden
  2022-02-26 22:16 ` Rob Pike
  2022-02-27 20:32 ` Sven Mascheck
  0 siblings, 2 replies; 20+ messages in thread
From: Brian Walden @ 2022-02-26 21:45 UTC (permalink / raw)
  To: tuhs

6th Edition used the Thompson shell as /bin/sh. I don't think it had
those capabilities. Sometimes you could find an early version of the
Bourne shell in /bin/nsh (new shell) in v6.

The 7th Edition made the Bourne shell /bin/sh. And there sometimes
you could find the Thompson shell in /bin/osh (old shell).

Will Senn wrote:
> Login commands question:
>
> I'm sure it's simple, but I can't figure it out. How do I get something
> to run at login in v6? Right now, I use ed to create a file 'setprof'
> that contains:
>
>     stty erase[space][backspace][return]
>     stty nl0 cr0
>
> Then after logging in:
>
>     sh setprof
>
> It works, but, it is pretty clunky.
>
> stty question:
>
> So, I looked at stty.c and it looks like the following should work, if
> the terminal is sending ^H for backspace:
>
>     #define BS0     0
>     #define BS1     0100000
>
>     modes[]
>     ...
>              "bs0",
>              BS0, BS1,
>
>              "bs1",
>              BS1, BS1,
>
>
> but:
>
>     stty bs0
>     or
>     stty bs1
>
> don't result in proper backspace handling..
>
> but:
>
>     stty[space][^h][return]
>
>
> works...
>
> Thoughts?

^ permalink raw reply	[flat|nested] 20+ messages in thread
* [TUHS] run commands at login in v6 and stty
@ 2022-02-26 20:39 Will Senn
  2022-02-26 21:03 ` Michael Kjörling
  2022-02-26 22:49 ` Clem Cole
  0 siblings, 2 replies; 20+ messages in thread
From: Will Senn @ 2022-02-26 20:39 UTC (permalink / raw)
  To: TUHS main list

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

Login commands question:

I'm sure it's simple, but I can't figure it out. How do I get something 
to run at login in v6? Right now, I use ed to create a file 'setprof' 
that contains:

    stty erase[space][backspace][return]
    stty nl0 cr0

Then after logging in:

    sh setprof

It works, but, it is pretty clunky.

stty question:

So, I looked at stty.c and it looks like the following should work, if 
the terminal is sending ^H for backspace:

    #define BS0     0
    #define BS1     0100000

    modes[]
    ...
             "bs0",
             BS0, BS1,

             "bs1",
             BS1, BS1,


but:

    stty bs0
    or
    stty bs1

don't result in proper backspace handling..

but:

    stty[space][^h][return]


works...

Thoughts?

[-- Attachment #2: Type: text/html, Size: 1854 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2022-02-28 21:27 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28  1:04 [TUHS] run commands at login in v6 and stty Douglas McIlroy
2022-02-28  7:22 ` Rob Pike
2022-02-28 14:07   ` Larry McVoy
2022-02-28 18:47     ` Dan Cross
2022-02-28 19:25       ` Dan Cross
2022-02-28 21:25         ` markus schnalke
2022-02-28 19:26       ` Clem Cole
2022-02-28 20:03         ` Adam Thornton
2022-02-28 18:18 ` Warner Losh
  -- strict thread matches above, loose matches on Subject: below --
2022-02-27  7:48 Noel Chiappa
2022-02-26 21:45 Brian Walden
2022-02-26 22:16 ` Rob Pike
2022-02-27 20:32 ` Sven Mascheck
2022-02-26 20:39 Will Senn
2022-02-26 21:03 ` Michael Kjörling
2022-02-26 22:49 ` Clem Cole
2022-02-26 23:12   ` Rob Pike
2022-02-27  0:46     ` Clem Cole
2022-02-27 15:01     ` Larry McVoy
2022-02-27 17:10       ` Clem Cole

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).