小编Dro*_*ans的帖子

解释为什么 .bash_logout 不会运行命令?

所以我一直想知道如何在每次关闭终端的打开实例时运行这两行代码:

history -c
cat /dev/null > ~/.bash_history
Run Code Online (Sandbox Code Playgroud)

export HISTFILE=5在启动时,但仍然想在我完成后将其清除。

我试过在几个地方环顾四周但运气不佳

我运行 Linux Mint,并且还要注意这里我遇到了类似的问题.bash_profile;最终,我发现我需要将所有启动代码放在.bashrc. 这是我的.bash_logout文件:

#!/bin/bash
# ~/.bash_logout: executed by bash(1) when login shell exits.

#this does nothing on exit...
echo 'logout'; sleep 2s

# when leaving the console clear the screen to increase privacy

if [ "$SHLVL" = 1 ]; then
    history -c
    cat /dev/null > ~/.bash_history
    [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi
Run Code Online (Sandbox Code Playgroud)

我已经尝试以多种方式重新安排这个脚本,我不确定我是否不明白 bash …

terminal linux-mint .bash-profile

12
推荐指数
2
解决办法
2万
查看次数

Can I make Emacs start in text-terminal mode (no window, like `emacs -nw`) by default?

I don't want to get sidetracked too much here, but emacs -nw (in my opinion) ought to open a graphical instance of emacs, with a popup. However, foregoing the -nw switch will bring up the GUI, and an embedded CLI version is implied by the new window switch?

Anyway, can I make this

emacs myfunscript.py
Run Code Online (Sandbox Code Playgroud)

run as this

emacs myfunscript.py -nw
Run Code Online (Sandbox Code Playgroud)

and keep my business on the command line, where I've grown to like it?

Thanks.

emacs

5
推荐指数
1
解决办法
1387
查看次数

标签 统计

.bash-profile ×1

emacs ×1

linux-mint ×1

terminal ×1