LinuxQuestions.org
Register a domain and help support LQ
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 07-31-2015, 03:04 AM   #1
arun natarajan
Member
 
Registered: Jun 2014
Posts: 96

Rep: Reputation: Disabled
cmd not found , issue in variable


Hi All,

Not able to execute the cmds without the fullpath. Given the screen shot here. Let me know if there any settings issue.

[root@server152 ibm]# cat 1.sh
-bash: cat: command not found

[root@server152 ibm]# which cat
/usr/bin/which: no cat in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ;:/root/bin)

[root@server152 ibm]# /bin/cat 1.sh

a=1
b=2
c=`expr $a + $b`
echo $c

[root@server152 ibm]#
 
Old 07-31-2015, 03:10 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Check your enviromental variables. env for the command. Also check the $PATH variable.
 
Old 07-31-2015, 05:09 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,250

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
Look at your PATH variable. If you look closely at the output you have provided where you use the 'which' command, you will see an issue in your path where "/bin" is.
 
  


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
Issue sg_modes cmd at cmd line, want to see the cmd in binary form NuUser Linux - Newbie 1 03-28-2012 09:08 AM
Need help with script writing: Storing cmd in variable, print variable, then exe cmds Arodef Programming 3 01-17-2012 01:26 AM
mt cmd not found - RHEL 5.2 pyroman59 Linux - Newbie 2 11-19-2009 05:51 PM
iostat cmd not found karthic Linux - Enterprise 2 03-22-2005 06:04 AM
installpkg cmd not found Hectic Slackware 2 10-13-2004 08:31 AM


All times are GMT -5. The time now is 04:39 AM.

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