Why aliases in a non-interactive Bash shell do not work

前端 未结 4 789
青春惊慌失措
青春惊慌失措 2020-11-27 15:27

I am trying to use aliases in a non-interactive bash shell. I have defined my aliases in ~/.bashrc and I have set the variable BASH_ENV=~/startUpFile

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-27 16:16

    I had similar issue, in the end, I found out that ~/.bashrc was all I needed.

    However, in Ubuntu, I had to comment the line that stops processing ~/.bashrc :

    If not running interactively, don't do anything
    [ -z "$PS1" ] && return
    

提交回复
热议问题