Xavier Maillard wrote in
 <[email protected]>:
 |Continuing my trip to s-nail mastering through the huge(st) manpage \
 |I've read.
 |
 |I see a lot of refrerences to wysh. What is it exactly ?

Oh.  Now it gets complicated, Xavier.
In short: wysh is a command modifier, and it will switch the
command it is used with to sh(1)ell-style quoting.
This however only works with certain commands.

The problem is that it is not a "language", like the shell
language that you (i presume) know.
Instead, it parses an input line, figures out which command,
actually, is to be invoked, and then parses the remains of the
line with a command-specific mode.

Furthermore: traditionally, it uses a simple way of specifying
commands, as can be read in the manual section "Old-style argument
quoting".  This is very limiting, but it would have been a major
effort to convert all commands in one go, and, furthermore,
certain commands work better without any argument quoting at all
(imho), ie, "what you write is exactly what you mean".

It would have been a major effort for several reasons, actually,
the state machine for example is still very limiting, even with
v14.10, for example, there will be no loops, and you will not be
able to say "define macro { echo bla; }", you still need to place
this on three adjacent lines.

So in 2015 i think it was i was in a complete dead end, and it
could be somewhen around was watching that Enterprise series with
Spock etc from the 60s, with that "swooosh" sound (well, more or
less) in the introductional scene (at least in the german
version), and then i suddenly had the idea that a wyysssshhhhh
modifier could warp (so to say) certain aspects of the user
interfaces to the future.  That is wysh: if used, it changes the
semantics of the next command to shell-style quoting, whereas, in
the normal case, backward compatible behaviour can be seen.

  $ mailx -:/ -R
  mailx version v14.9.25.  Type `?' for help
...
  ? set verbose
  ? ?alias
  alias: Show all (or <alias>), or append to <alias> :<data>:
    : sh(1)ell-style quoting | yay: send-mode

^ So `alias' in the meantime has been converted in full.

  ? ?mail
  mail: Compose mail; recipients may be given as arguments
    : string data | *!* | yay: batch/interactive send-mode | nay: compose-mode

^ This is plain string data without any shell stuff.

  ? ?set
  set: Print all variables, or set (a) <variable>(s)
    : `wysh' for sh(1)ell-style quoting | `local' | yay: send-mode subprocess | 
gabby

^ And `set' is backward-compatible, unless wysh was given.

v14.10 will see changes also there:

  $ s-nail -:/ -R
  s-nail version v14.9.25-642-gda4de7d05f.  Type `?' for help
...
  ? se verbose; ?alias; ?mail; ?set; uns verbose;xit
  alias: (a) Show all (or [*metoo*: -[-+]] <alias>), or append to <alias> 
:<data>:
    : sh(1)ell-style quoting | yay: send-mode
  mail: (m) Compose mail; recipients may be given as arguments
    : argument tokens: [] | `local' | *!* | yay: batch/interactive | nay: 
compose-mode startup (pre -X)
  set: (se) Print all variables, or set (a) <variable>(s)
    : argument tokens: [:(shell-)token [$*/$@ expand in field] [no field 
splitting]:] | `local' | `our' | yay: send-mode | history:gabby

Xavier, have you self-compiled s-nail?  Or is that a package?  If
you have self-compiled, you *possibly* want to switch over to the
development version, if you start learning from scratch.  It will
bring lots of progress especially in that area.  And wysh, for
example, is gone.  (It is a no-op now, and will vanish soon.)

--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)

Reply via email to