Current-Users archive

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

Latest shell updates



I have just committed the updates to enable prompt expansion (posix standard
for variable expansion, arithmetic coming, command substitutions possible)
and several new shell variables, many of which are intended for use in
prompts (set in PS1 unexpandsd, as
	PS1='${Tod} ${HOSTNAME%%.*} ${PSc} '
rather than pre-expanded as
	PS1="${Tod} ${HOSTNAME%%.*} ${PSc} "
which would get you the values of the variables at the time the promot is
set, rather than when it is used as a prompt.

This does mean that you need to be careful with $ (and \ if you happen to
use it) in prompt strings - a simple '$' followed by a space or the end of
the prompt string is not a problem, but a '$' followed by anything which
looks like either a variable name (including '{') or a numeric parameter
(ie: a digit) or a special param (! ? # ...) will now be expanded (perhaps
just to a null string.)

This is the last change of substance that I am hoping will make NetBSD 8,
so please test it - in combination with the PSlit changes (and libedit
upgrades) from the past few days - and test soon is possible, so the
pullup requests can get made.

Testing prompts containing non-ascii characters (encoded according to whatever
your locale expects) would be much appreciated.   Even better if you can
also find a use for non-ascii characters which do not get printed (are
embedded between PSlit characters - one possible use would be to use this
for setting a non-ascii string into an x-xterm title bar .. if xterms support
that.)

None of the recent changes should (or are likely to) make any difference to
the way the shell handles scripts, this is all mostly interactive and prompting
related.

RANDOM is one of the new variables, currently implemented using lrand48(3)
though commenting out one line in the sh Makefile will change it to use
random(3) instead.   I have no idea whether the "random" numbers generated
are in any statistical sense random.

kre



Home | Main Index | Thread Index | Old Index