we already do not 'function\nfoo\n{' for shell, like style(9) requires for
C programming, but 'function foo\n{' instead. however, we could treat the
function keyword as indentation initialiser and use 'function foo {' (on a
line for itself) – it looks different, unusual, but acceptable, and mksh's
own output (dumping with the “functions” builtin) does that too (although,
its indentation style sucks, but is legible enough)
place most stuff from /etc/profile in /etc/skel/.mkshrc; admins must make
sure to copy this file to users' homes on upgrade (benefit: non-login but
interactive shells also get all the goodies); fix some quoting; simplify,
reformat, change comments
• from an mksh point of view:
slight internal changes in dot.mkshrc; external commands are now prefixed
with “ulimit -c 0”; $TERM is defined; improvement in determining the host
name (e.g. on Debian if a FQDN is not given); declare locals as such both
in $PS1 and outside; remove superfluous quoting, quote properly; simplify
hd alias, add rot13 alias; place RCS ID at the bottom
and have it return an API-correct const char *
• enhance and stylify comments
• a little KNF and simplifications
• #ifdef DEBUG: replace strchr and strstr with ucstrchr and ucstrstr
that take and return a non-const char *, and fix the violations
• new cstrchr, cstrstr (take and give const char *)
• new vstrchr, vstrstr (take const or not, give boolean value)
• new afreechk(x) = afreechv(x,x) = if (x1) afree(x2, ATEMP)
• new ksh_isdash(str) = (str != NULL) && !strcmp(str, "-")
• replace the only use of strrchr with inlined code to shrink
• minor man page fixes
• Minix 3 signames are autogenerated with gcc
• rename strlfun.c to strlcpy.c since we don't do strlcat(3) anyway,
only strlcpy(3), and shorten it
• dot.mkshrc: move MKSH=… down to the export line
to not disturb the PS1 visual impression ☺
• dot.mkshrc: Lstripcom(): optimise
• bump version
¹) side effect from creating API-correct cstrchr, cstrstr, etc.
uses goto so it must be better ☻
tested on mirbsd-current via both Makefile and Build.sh
of a pipeline is executed in a subshell' trick, don't use co-process
(because that's verbose twice in an interactive shell profile), move
the noglob block into the while and rid the redundant +o and local.
* sync dot.mkshrc sample with FreeWRT r383
* add some stuff from src/etc/profile and contrib/samples/etc_profile
* sync the latter two with reality and shorten
* teach the user in the mksh installation instructions to install the sample
NB: the sample is also covered by the MirOS licence