* get dot.mkshrc sample from Debian mksh-27.4-2
* 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
This commit is contained in:
parent
80c579a758
commit
f1e8f970c4
3
Build.sh
3
Build.sh
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# $MirOS: src/bin/mksh/Build.sh,v 1.32 2006/07/03 12:17:08 tg Exp $
|
# $MirOS: src/bin/mksh/Build.sh,v 1.33 2006/07/23 18:44:22 tg Exp $
|
||||||
#-
|
#-
|
||||||
# This script recognises CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS and NROFF.
|
# This script recognises CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS and NROFF.
|
||||||
|
|
||||||
@ -93,6 +93,7 @@ $e
|
|||||||
$e Installing mirbsdksh:
|
$e Installing mirbsdksh:
|
||||||
$e "# install -c -s -o root -g bin -m 555 mksh /bin/mksh"
|
$e "# install -c -s -o root -g bin -m 555 mksh /bin/mksh"
|
||||||
$e "# fgrep -qx /bin/mksh /etc/shells || echo /bin/mksh >>/etc/shells"
|
$e "# fgrep -qx /bin/mksh /etc/shells || echo /bin/mksh >>/etc/shells"
|
||||||
|
$e "# install -c -o root -g bin -m 444 dot.mkshrc /usr/share/doc/mksh/examples/"
|
||||||
$e
|
$e
|
||||||
$e Installing the manual:
|
$e Installing the manual:
|
||||||
if test -s mksh.cat1; then
|
if test -s mksh.cat1; then
|
||||||
|
36
dot.mkshrc
Normal file
36
dot.mkshrc
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# $MirOS: src/bin/mksh/dot.mkshrc,v 1.1 2006/07/23 18:44:22 tg Exp $
|
||||||
|
|
||||||
|
: ${HOSTNAME:=$(hostname -s 2>/dev/null || hostname)}
|
||||||
|
PS1='$(((rv=$?)) && print $rv\|)${USER:=$(id -un)}@${HOSTNAME:=nil}:$(
|
||||||
|
local pfx=~ wd=${PWD:-$(pwd)}
|
||||||
|
[[ ${wd#$pfx} = $wd || $pfx = ?(/) ]] || wd=\~${wd#$pfx}
|
||||||
|
pfx=; let n="( (n = ${COLUMNS:-80} / 3) < 7 ? 7 : n)"
|
||||||
|
while (( (${#pfx} + ${#wd}) > n )); do
|
||||||
|
if [[ $wd = */* ]]; then
|
||||||
|
pfx=.../
|
||||||
|
wd="${wd#*/}"
|
||||||
|
else
|
||||||
|
pfx=...
|
||||||
|
wd="${wd#?????}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
print -r -- "$pfx$wd")'" $(if (( $(id -u) )); then
|
||||||
|
print \$; else print \#; fi) "
|
||||||
|
: ${EDITOR:=/bin/ed}
|
||||||
|
export EDITOR HOSTNAME PS1 USER
|
||||||
|
|
||||||
|
alias l='/bin/ls -F'
|
||||||
|
alias la='l -a'
|
||||||
|
alias ll='l -l'
|
||||||
|
alias lo='la -lo'
|
||||||
|
|
||||||
|
function Lstripcom # strip comments from file
|
||||||
|
{
|
||||||
|
local _line
|
||||||
|
set -o noglob
|
||||||
|
cat "$@" | while read _line; do
|
||||||
|
_line=${_line%%#*}
|
||||||
|
[[ -n $_line ]] && print -r -- $_line
|
||||||
|
done
|
||||||
|
set +o noglob
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user