tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Fwd: Re: interactive shell detection in shrc



RVP wrote in
 <4d7cdca7-fcf4-8985-7c1d-79ef63125e00%SDF.ORG@localhost>:
 |On Tue, 24 Sep 2024, Steffen Nurpmeso wrote:
 |> Robert Elz wrote in
 |> <7132.1727161873%jacaranda.noi.kre.to@localhost>:
 |>|    Date:        Tue, 24 Sep 2024 00:56:40 +0200
 |> [...]
 |>| if $___SHRC
 |>
 |> Oh, i would be afraid of doing this implicit test.  I no longer
 |> have many shells around, not even as source code, so i would not
 |> dare to do this.
 |
 |Yes, this surprised me too. This test is true if $___SHRC is undefined,
 |which is why kre said,

It is also all the bugs everywhere; if a shell does not dig the
"there has been meat" then it may vanish to nothing, as in other
contexts it even has to

  #?0|kent:tmp$ i=i j=\ s; echo a $i${j} b
  a i s b
  #?0|kent:tmp$ i= j=\ s; echo a $i${j} b
  a s b

 |>|If you insist on quoting the expansion in the first line,
 |>|it needs to become:
 |>|
 |>| if "${___SHRC:-:}"
 |>
 |> A syntax error of yours?
 |
 |No, that becomes `if ":" ...' $___SHRC is undefined or empty. You need to
 |write it that way, else it's a syntax error.

Thanks for this.  Yes, i had not understood this shall end up as
the : no-op in the end.  (Even more bogus given that kre@ at times
persuaded me to use "while :;" etc loops instead of "while true;"
etc, so .. i failed.)

  ...
 |> years; especially since on this laptop the "g" key stopped working
 |> after a few weeks, and ever since i have to use
 |>
 |>  keycode  41 = f F g G g G
 |>
 |
 |Heh. I had to do the same on one of my old laptops; except a lot more keys
 |were non-functional, so:
 |
 |```
 |$ cat /mnt/bak/sdf/tmp/nbsd/qey.sh 
 |#!/bin/sh
 |
 |wsconsctl -dw font='Boldface 16x32'
 |wsconsctl -w encoding=us.swapctrlcaps
 |while read line
 |do      wsconsctl -w map+="$line"
 |done <<\EoF
 |keycode 1 = grave asciitilde
 |keycode 14 = BackSpace
 |keycode 211 = KP_Delete
 |keycode 41 = Escape
 |keycode 24 = o O i I
 |keycode 31 = s S a A
 |keycode 33 = f F d D
 |keycode 35 = h H g G
 |keycode 38 = l L k K
 |keycode 49 = n N m M
 |keycode 52 = period greater slash question
 |keycode 219 = Mode_switch
 |EoF
 |$
 |```
 |
 |You produce the broken keys using Win+adjacent-to-broken key.

These are quite a lot..  But it is surprising how naturally it
became.  Here in the jungle every little piece wants extra
config.

 |(Why is the script called `qey.sh' instead of `key.sh'? Because the \
 |`k' key is
 |broken :))

There you go.  In general i am always happy when i have setup a VM
and go via ssh, so often SDL keymap was/is wrong (especially EFI
/ boot), and VNC i even no longer use at all because you surely be
unable to use some things.

 |-RVP
 --End of <4d7cdca7-fcf4-8985-7c1d-79ef63125e00%SDF.ORG@localhost>

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


Home | Main Index | Thread Index | Old Index