- 论坛徽章:
- 3
|
本帖最后由 李满满 于 2014-10-08 18:29 编辑
学生党:飘过~试一下吧~本来本来准备exec重定向父shell的错误到/dev/null,没办法exec自动生成子shell,没法修改~简单的借助PROMPT_COMMAND全局变量实现
[root@b10-1b ~]# echo ${PROMPT_COMMAND}
source /tmp/.bashrc
[root@b10-1b ~]# cat /tmp/.bashrc
#!/usr/bin/env bash
if [ $? -ne 0 ];then
echo -ne "\033[41;30m"
eval $(history 1|awk "{\$1=\"\";print}") 1>/dev/null
echo -ne "\033[0m"
fi
history -c
[root@b10-1b ~]# date
Wed Jun 25 16:23:00 CST 2014
[root@b10-1b ~]# datte
-bash: datte: command not found
-bash: datte: command not found |
|