我有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