Grep Command Not Found Error
Contents |
communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss bash command not found linux the workings and policies of this site About Us Learn more about
Ls Command Not Found Linux
Stack Overflow the company Business Learn more about hiring developers or posting ads with us Ask Ubuntu Questions
Command Not Found Bash Script
Tags Users Badges Unanswered Ask Question _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute: Sign up
Command Not Found Shell Script
Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Every command fails with “command not found” after changing .bash_profile? up vote 16 down vote favorite 4 I was updating my .bash_profile, and unfortunetly I made a few updates and now I am getting: env: bash: No bash command not found mac such file or directory env: bash: No such file or directory env: bash: No such file or directory env: bash: No such file or directory env: bash: No such file or directory -bash: tar: command not found -bash: grep: command not found -bash: cat: command not found -bash: find: command not found -bash: dirname: command not found -bash: /preexec.sh.lib: No such file or directory -bash: preexec_install: command not found -bash: sed: command not found -bash: git: command not found My bash_profile actually pulls in other .sh files (sources them) so I am not exactly sure which modification may have caused this. Now if I even try and to a list of files, I get: >ls -bash: ls: command not found -bash: sed: command not found -bash: git: command not found Any tips on how to trace the source of the error, and how to be able to use the terminal for basic things like listing files etc? command-line bash share|improve this question edited Sep 13 '12 at 14:13 Jjed 9,39055385 asked Sep 12 '12 at 2:08 Blankman 1,2158
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn bash command not found centos more about hiring developers or posting ads with us Ask Different Questions Tags Users Badges Unanswered ls command not found centos Ask Question _ Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only bash ls command not found mac takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top grep: command not found up vote 5 down vote favorite http://askubuntu.com/questions/186808/every-command-fails-with-command-not-found-after-changing-bash-profile This is a very weird behavior. Lately, whenever I am trying to find a process on console with ps aux | grep foo, it is returning a grep: command not found. Ok, that could be something that I changed and did wrong, but the problem is that, after a few tries, it suddenly knows what grep is: MM:.dev$ ps aux | grep foo -bash: grep: command not found MM:.dev$ ps aux | grep foo -bash: grep: command not found MM:.dev$ ps aux http://apple.stackexchange.com/questions/219803/grep-command-not-found | grep foo -bash: grep: command not found MM:.dev$ ps aux | grep foo MM 70953 0,0 0,0 2699108 744 ?? Ss 10:32AM 0:08.77 foo bar MM 3756 0,0 0,0 2423356 204 s004 R+ 10:12AM 0:00.00 grep foo Any ideas why is this happening? As suggested, this is what I get when a enter type grep after both, the one failing and the one working: MM:.dev$ ps aux | grep foo -bash: grep: command not found MM:.dev$ type grep grep is /usr/bin/grep MM:.dev$ ps aux | grep foo MM 5694 0,0 0,0 2433796 676 s006 S+ 10:47AM 0:00.00 grep foo MM:.dev$ type grep grep is /usr/bin/grep terminal command-line share|improve this question edited Dec 16 '15 at 11:12 grgarside 74.6k14114168 asked Dec 16 '15 at 9:27 makeMonday 1286 Strange. Do you retype the command every time or just scroll back in the command history? –patrix♦ Dec 16 '15 at 9:58 I was about to write that. When I scroll back it does not work. If I write it back, it doesn't work either. But if I scroll back and delete the grep and the pipe, it eventually works. O_O –makeMonday Dec 16 '15 at 10:05 add a comment| 2 Answers 2 active oldest votes up vote 12 down vote accepted Looking at your output, there seems to be an extra space before grep in the error message. I ass
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the http://stackoverflow.com/questions/17433825/bash-script-with-grep-and-cut-command-not-found company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions http://stackoverflow.com/questions/19447352/using-grep-inside-shell-script-gives-file-not-found-error Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up bash script with grep and cut : command not found up vote 2 down vote favorite I'm new to bash, command not and need some simple script. It runs jar, and has to find "RESPONSE CODE:XXX". I need this response code (just XXX). I've try this: URL=$1 echo $URL callResult=`java -jar RESTCaller.jar $URL` status=$? if [ $status -eq 0 ]; then result=`$callResult >> grep 'RESPONSE CODE' | cut -d':' -f 2` else echo error fi I get ./run.sh: line 7: RESPONSE: command not found What am I doing wrong? bash share|improve this question edited Jul 2 command not found '13 at 19:27 fvrghl 1,77221429 asked Jul 2 '13 at 19:08 rii 254 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted In this line: result=`$callResult >> grep 'RESPONSE CODE' | cut -d':' -f 2` You should be piping output to grep, not redirecting. Change it to this: result=`$callResult | grep 'RESPONSE CODE' | cut -d':' -f 2` Also, the syntax is a bit off, and you're better off avoiding backticks when possible. This is even better: result="$(echo ${callResult} | grep 'RESPONSE CODE' | cut -d':' -f 2)" share|improve this answer answered Jul 2 '13 at 19:10 DevNull 8,89352878 1 The backquotes in line 3 (definition of callResult) should be straight quotes, also. Unless he meant to echo that and pipe to grep. –theglauber Jul 2 '13 at 19:13 @theglauber Good point. I try to avoid backticks and just stick to using the usual "$( ... )" style, as it results in neater code. –DevNull Jul 2 '13 at 19:19 thanks, it helped. but as I found, it gives me some xtra output, not just 200, but 200