bashrc and .bash_profile
hi all,
I have a bash script. It is running by a group of users; and they have a special .bash_profile and .bashrc. How do I include .bash_profile and .bashrc in my script, so that when others run it, it should be able to find all commands and alias inside those bash files Thank you for your time and help. |
and the error code when they run my script is 127
|
See your own ~/.bashrc to see how it sources /etc/bashrc
The with ~/.bash_profile |
Hi Primo,
My .bash_profile is like this: if [ -f ~/.bashrc ]; then . ~/.bashrc fi so I did a similar thing to my script by putting if [ -f ~/.bash_profile ]; then . ~/.bash_profile fi inside it. But the problem still persists. |
From the bash manpage:
Quote:
|
I follow your instruction, and everything looks fine....no problem.
Oh, I forgot to mention that, I call this script from a java program. Runtime.exec(bash); and the bash file is like a wrapper that runs other script. If I was to run the bash file against those scripts directly w/o going through java, everything works fine. But If java calls the wrapper, then wrapper executes those script; the result is 127....and sometimes is 1. |
All times are GMT -5. The time now is 11:51 AM. |