1 Star 0 Fork 16

Linux_zhang/ksh

forked from src-openEuler/ksh 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
kshrc.rhs 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
tubalu 提交于 2020-01-13 11:25 +08:00 . package init
#
# /etc/kshrc is sourced in interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
# Set prompts
#PROMPT='[%n@%m]%~%# ' # default prompt
#RPROMPT=' %~' # prompt for right side of screen
_src_etc_profile_d()
{
# from zshrc, with ksh fixes
if [[ ! -o login ]]; then # We're not a login shell
for i in /etc/profile.d/*.sh; do
if [ -r "$i" ]; then
. $i
fi
done
unset i
fi
}
pathmunge () {
case ":${PATH}:" in
*:"$1":*)
;;
*)
if [ "$2" = "after" ]; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
esac
}
_src_etc_profile_d
unset -f _src_etc_profile_d
unset -f pathmunge
# key bindings - make Delete, Home, End,... work
keybd_trap () {
case ${.sh.edchar} in
$'\e[1~') .sh.edchar=$'\001';; # Home = beginning-of-line
$'\e[F') .sh.edchar=$'\005';; # End = end-of-line
$'\e[5~') .sh.edchar=$'\e>';; # PgUp = history-previous
$'\e[6~') .sh.edchar=$'\e<';; # PgDn = history-next
$'\e[3~') .sh.edchar=$'\004';; # Delete = delete-char
esac
}
trap keybd_trap KEYBD
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Linux_zhang2024/ksh.git
git@gitee.com:Linux_zhang2024/ksh.git
Linux_zhang2024
ksh
ksh
master

搜索帮助