![]() |
grep command not found !
Hi,
I switched recently to os x and so. I usually connect to linux machines via ssh and sometimes I get strange errors when I try to do "history | grep monday " like " grep, command not found ". This is very strange. Of course if I am loggend from a linux machine and I connect to this one and I do the same, I do not get this error. And this error seems to occurr randomly. And also happens with some other commands like "last", etc Regards Horacio |
See the "command not found" & "shell config" sections of this Unix FAQ.
(It sounds like you have your "dot" files setting an inappropriate PATH.) |
Hi,
that is not my problem. I checked on the linux machine which I connect to, that the commands "grep" etc are in the path, and they are. The strange problem is the following: - if I just do "grep", this is ok grep Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more information. but if I use pipes there are errors; ps -ef |*grep whatever -bash: *grep: command not found Any ideas ? |
Quote:
Quote:
That is not the normal construct. To pipe the output of 'ps -ef' into 'grep', you use: ps -ef | grep whatever |
sorry, the * was a mistake of mine
I use the right thing: ps -ef | grep whatever |
it is really a pity that the shell in mac os x does NOT really work like it should
|
Quote:
|
on mac os x it works for me without problems.
if you read what i write before, when i log on to a linux machine, then i get the error there. but that's not a problem of the remote linux machine because if a connect there from another linux machine, then no problem a t all grüsse |
Quote:
Please show us the command you are running and the error messages (verbatim). |
everything is described before, anyway
1- from mac os x i open the terminal and log to a linux machine using ssh 2- once logged there i type; ps -ef | grep hijodeputa 3- i get; -bash: grep: command not found if i connect from linux to linux of i am directly on the screen of that linux machine, i do not get this error btw, it happens randomly with another commands like "more", etc |
Quote:
So please reproduce the problem and then copy/paste the whole contents of your Terminal window here so we can see. And before (or after) you run that command, please run the following commands (and of course include these commands & output in what you show us): echo $PATH which grep command -V grep |
Code:
sanchez@intsanchez:~> ps -ef |*grep hijodeputa |
Quote:
|
yes ?????????????
|
eres pendejo?
|
only english please, so everybody can understand it
|
sorry, when pasting my previous output, there is an asterik before the "grep" which i never type, i do not why it appears here
Code:
sanchez@intsanchez:~> ps -ef | grep hijodeputa |
the last post is the right one
|
Is that an actual copy/paste from the Terminal, or did you just edit the transcript to remove the asterisks?
It looks like you just edited the transcript to remove the asterisks, since there's an extra space before 'grep' in the Code:
-bash: grep: command not foundTrevor |
now i realize about everything
for some reason, when i type at the terminal ps -ef |*grep something there is some kind of hidden asterisk there but if i delete that space between the pipe and grep and add one or two spaces, then the problem is gone ok, i dont understand anything, but i chekced it out on different machines and the problem is gone, who cares about the reason :-P |
Quote:
One thing I don't understand - when you say: Quote:
It looks like you are typing a space and then a vertical bar (|) and then an asterisk and then a 'g'. Are you typing something after the vertical bar before you type the 'g' ? Or maybe (most likely) the problem is with the vertical bar itself. What key are you pressing to get the vertical bar? What type of keyboard do you have on your Mac? Is the vertical bar on the key at the right-side just above the Return key? What model of Mac do you have? What language is set for keyboard input? |
Even though this post is very old. It helped me by giving the hint with the hidden asterisk.
This hidden character is triggered when the <alt>-key is not released before pressing the <space>-key. The german keyboard layout uses the <alt>-key to enter a pipe. <space> != <alt><space> Maybe its a Problem with the Keyboard Layout. |
| All times are GMT -5. The time now is 05:31 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.