NetBSD-Users archive

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

Re: How do you set $PS1 on /bin/ksh



Here's mine,
# .shrc file for sh(1).
ll(){ ls -l ${1+"$@"}; }
case "$-" in *i*)
if /bin/test -z "${HOST}"; then
HOST="$(hostname)"
fi
PS1="${USER}@${HOST%%.*} $PS1"
set -o emacs
;;
esac


Den fre 24 jan. 2020 17:30Ottavio Caruso <ottavio2006-usenet2012%yahoo.com@localhost> skrev:
Hi,

[hoping my post doesn't arrive duplicated or triplicated]

How do you set the prompt in ksh? The man page doesn't seem to help.
OpenBSD ksh has a different manpage. Compare:
https://man.openbsd.org/ksh.1#PS1
and
https://netbsd.gw.com/cgi-bin/man-cgi?ksh

For example:
PS1="\u@\h:\w\$ "

is not expanded.

Thanks

--
Ottavio Caruso


Home | Main Index | Thread Index | Old Index