LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-28-2010, 06:41 PM   #1
buee
Member
 
Registered: May 2009
Posts: 81

Rep: Reputation: 16
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?
 
Old 04-28-2010, 06:51 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,808

Rep: Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604
PATH not the same
 
Old 04-28-2010, 09:44 PM   #3
casoe84dk
LQ Newbie
 
Registered: Aug 2009
Posts: 22

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash Scripts if files (plural) exist Drigo Linux - Newbie 9 04-24-2010 12:19 PM
Commands do not exist :-s redice Fedora 2 03-05-2006 07:02 AM
commands in terminal don't exist lefty.crupps Linux - Software 2 05-05-2005 11:03 AM
Bash says that config (ifconfig, chkconfig and others) don't exist Pedal2Metal Linux - Software 2 10-21-2004 06:50 AM
Bash backup script - If multiple files starting with a exist problem demoncheese Programming 2 07-29-2004 11:47 PM


All times are GMT -5. The time now is 08:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration