LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cmd not found , issue in variable (https://www.linuxquestions.org/questions/linux-newbie-8/cmd-not-found-issue-in-variable-4175549433/)

arun natarajan 07-31-2015 02:04 AM

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]#

zhjim 07-31-2015 02:10 AM

Check your enviromental variables. env for the command. Also check the $PATH variable.

grail 07-31-2015 04:09 AM

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.


All times are GMT -5. The time now is 10:00 AM.