从 bash 脚本回显 ~/.bashrc PATH

从 bash 脚本回显 ~/.bashrc PATH

我有mybashscript.sh

#!/bin/bash -i

alias brc='source ~/.bashrc'

source /usr/local/MYPROGRAM/bin/myapp
#exec bash
echo "******************pathhhhhhhh************"
echo $PATH
echo "******************pathhhhhhhh************"
/usr/local/MYPROGRAM/bin/myapp

这是我运行时的输出./mybashscript.sh

bash: /bin/realbin/myapp: No such file or directory
******************pathhhhhhhh************
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
******************pathhhhhhhh************
/usr/local/MYPROGRAM/bin/myapp: 3: /usr/local/MYPROGRAM/bin/myapp: /bin/realbin/myapp: not found

我想知道为什么$PATH没有~/.bashrc出现?也myapp没有找到,尽管如果我从普通终端窗口运行它,myapp因为它的路径包含在~/.bashrc

相关内容