linux将shell脚本中的命令记入history

在脚本开头加上下面两句即可

HISTFILE=~/.bash_history
set -o history

 

posted @ 2025-01-17 14:52  94那抹微笑  阅读(11)  评论(0)    收藏  举报