I have an app on my Ubuntu machine installed in /usr/local/MYPROGRAM/bin/myapp. When I try using myfn in my bash script mybashscript.sh it gives an error saying that the myfn command is not found, but if I call myfn from a normal terminal window it works fine since it's found in the ~/.bashrc file. How I can call myfn from my bash script mybashscript.sh?
Here is 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
This is the output when I run ./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