LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Bash telling me commands don't exist when they do (https://www.linuxquestions.org/questions/linux-newbie-8/bash-telling-me-commands-dont-exist-when-they-do-804840/)

buee 04-28-2010 06:41 PM

Bash telling me commands don't exist when they do
 
I made a script that contains repetitious commands (snmpget and awk are the only ones at the moment. Running these commands from standard terminal work, but when run within a script, I get:

./reg_sm_count: line 10: snmpget: command not found
./reg_sm_count: line 10: awk: command not found
./reg_sm_count: line 10: snmpget: command not found
./reg_sm_count: line 10: awk: command not found
./reg_sm_count: line 10: awk: command not found
./reg_sm_count: line 10: snmpget: command not found
./reg_sm_count: line 10: snmpget: command not found
./reg_sm_count: line 10: awk: command not found
./reg_sm_count: line 10: snmpget: command not found
./reg_sm_count: line 10: awk: command not found
./reg_sm_count: line 10: snmpget: command not found
./reg_sm_count: line 10: awk: command not found
./reg_sm_count: line 10: snmpget: command not found
./reg_sm_count: line 10: awk: command not found

But when I issue the command straight at the terminal, it returns results. Feh?

AlucardZero 04-28-2010 06:51 PM

PATH not the same

casoe84dk 04-28-2010 09:44 PM

Remember, if you are running files in a script then, as standard you should use the full filepath, and not the bin/sbin name


All times are GMT -5. The time now is 12:29 AM.