David.Comay at Sun.COM wrote:
> > 2. The patch seems to miss /etc/ksh.kshrc which is important for ksh93
> > (see PSARC 2006/587 for the background. Short: Without this file ksh93
> > will not enable any editor mode (for strict POSIX shell conformance - we
> > work around this usability issue by enabling the "gmacs" editor mode in
> > that config file))
> 
> /etc/ksh.kshrc is already being delivered by SUNWcsr so the Distro
> Constructor does not need to deliver or create this file.

Uhm... Ok...
BTW: What about replacing the standard /etc/ksh.kshrc with this version
(it's like the current once except that it sets a custom prompt which is
modeled after the default for SuSE Linux):
-- snip --
#
# ${HOME}/.kshrc is read for interactive ksh93 shells after
/etc/ksh.kshrc
#
set -o gmacs
#set -o multiline

# Set terminal title
function work_topic
{
    typeset title="$1"
    print -n "\E]0;${title}\\007\\c"
}

# define default prompt to <username>@<hostname>:<path><"($|#) ">
PS1='${logna...@$(hostname):$(
    # 1. Define ellisis, either Unicode #2026 for unicode locales
    # and "..." otherwise
    # ([[ "${LC_ALL}/${LANG}" = ~(Elr)(.*UTF-8/.*|/.*UTF-8) ]]
    # ensures that the pattern matches the leftmost sequence
    # containing *.UTF-8, allowing to match either LC_ALL or
    # LANG when LC_ALL is not set)
    ellip="$(
        [[ "${LC_ALL}/${LANG}" = ~(Elr)(.*UTF-8/.*|/.*UTF-8) ]] &&
            printf "\u[2026]\n" || print "..." )"
    # 2. If PWD is within HOME replace value of HOME with '~'
    p="${PWD/~(El)${HOME}/\~}"
    # If the PWD is longer than 20 charatcers shorten it to 20 chars
    (( ${#p} > 20 )) &&
        print -r -n "${ellip}${p:${#p}-20:20}" || print -r -n "$p"
    # print '#' for user "root" and '$' for normal users
    [[ "$LOGNAME" = "root" ]] && print -n "# " || print -n "\$ ")'

-- snip --
(/etc/ksh.kshrc is for interactive shell sessions only, e.g. this will
not break any ksh/ksh93 scripts)


BTW: Two more ideas:
1. new/src/bootcd_skel/etc/default_env.sh - what about adding
/usr/xpg6/bin:/usr/xpg4/bin: in front of /usr/bin/ to get the XPG6 tools
(POSIX conformant and all multibyte-aware) by default, e.g.
-- snip --
PATH=/usr/xpg6/bin:/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/usr/openwin/bin:/opt/DTT/bin
export PATH
-- snip --
Note that the lookup order around /usr/bin/ must match the output of $
/usr/xpg6/bin/getconf CS_PATH #

2. What about setting the default locale to "en_US.UTF-8" (instead of
"C") to match the defaults for newer Linux distributions like SuSE >=
10.0 ?

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)

Reply via email to