Grep is not recognized as an internal or external command, operable program or batch file

'grep' is not recognized as an internal or external command.

Command:  aio cloudmanager:tail-logs author aemerror | grep debug

without grep trailing is working fine, can someone suggest?

Discussion:

Does grep work in Windows

[too old to reply]

In emacs 22 on windows should grep work?

I am typing m-x grep which opens a line in the mini buffer that says

Run grep [like this]: grep -n

and a message saying: Grep started at Tue Jan 23 21:19:22

I then add, as shown in the grepmode wiki the following to the mini buffer

-e setq ~/.emacs

giving me a full line in the minibuffer of

Run grep [like this]: grep -n -e setq ~/.emacs
hit return and get a message that says

'grep' is not recognized as an internal or external command,
operable program or batch file.

Can anyone point out what I am doing wrong.

Many thanks,

Graham

Post by Graham Smith
Run grep [like this]: grep -n -e setq ~/.emacs
hit return and get a message that says
'grep' is not recognized as an internal or external command,
operable program or batch file.
Can anyone point out what I am doing wrong.

Did you install grep? Is it in PATH?

--
Ralf

Ralf,

Thanks for the reply.

I have installed Grep from the gnuwin32 web site and "now" added it to the
PATH environmental variable. Same error.

The full error message is

*- mode: grep; default-directory: "~/" -*-
Grep started at Tue Jan 23 22:19:50

grep -n -e setq ~/.emacs NUL
'grep' is not recognized as an internal or external command,
operable program or batch file.

Grep finished with no matches found at Tue Jan 23 22:19:5

Post by Ralf Angeli

Post by Graham Smith
Run grep [like this]: grep -n -e setq ~/.emacs
hit return and get a message that says
'grep' is not recognized as an internal or external command,
operable program or batch file.
Can anyone point out what I am doing wrong.

Did you install grep? Is it in PATH?
--
Ralf
_______________________________________________
help-gnu-emacs mailing list
//lists.gnu.org/mailman/listinfo/help-gnu-emacs

Date: Tue, 23 Jan 2007 22:27:35 +0000
I have installed Grep from the gnuwin32 web site and "now" added it to the
PATH environmental variable. Same error.

Did you restart Emacs after installing Grep? Emacs won't notice any
changes to PATH while it [Emacs] is running.

If you did restart Emacs, please make sure that you modified PATH
correctly, i.e. in a way that will be in effect for all programs,
including Emacs. In practice, this means you should modify PATH via
Control Panel, not in the shell window.

grep -n -e setq ~/.emacs NUL
'grep' is not recognized as an internal or external command,
operable program or batch file.

This error message says that the OS cannot find grep.exe. You need to
find out why. Something in the way you installed Grep is not right.

Eli,

Thanks for your help.

I did restart Emacs, indeed I re-booted the PC. I modified the PATH via My
Computer|advanced|Environmental variable, and I have re-installed Grep.

In the end I gave up and installed Emacsw32, which comes with Grep, and its
now working.

I would rather have solved the problem but, for now this seems the more
efficient way of sorting it out.

Should I have added anything in the .emacs file?

Graham

Post by Eli Zaretskii

Date: Tue, 23 Jan 2007 22:27:35 +0000
I have installed Grep from the gnuwin32 web site and "now" added it to

the

PATH environmental variable. Same error.

Did you restart Emacs after installing Grep? Emacs won't notice any
changes to PATH while it [Emacs] is running.
If you did restart Emacs, please make sure that you modified PATH
correctly, i.e. in a way that will be in effect for all programs,
including Emacs. In practice, this means you should modify PATH via
Control Panel, not in the shell window.

grep -n -e setq ~/.emacs NUL
'grep' is not recognized as an internal or external command,
operable program or batch file.

This error message says that the OS cannot find grep.exe. You need to
find out why. Something in the way you installed Grep is not right.
_______________________________________________
help-gnu-emacs mailing list
//lists.gnu.org/mailman/listinfo/help-gnu-emacs

Post by Graham Smith
Eli,
Thanks for your help.
I did restart Emacs, indeed I re-booted the PC. I modified the PATH via My
Computer|advanced|Environmental variable, and I have re-installed Grep.
In the end I gave up and installed Emacsw32, which comes with Grep, and its
now working.
I would rather have solved the problem but, for now this seems the more
efficient way of sorting it out.
Should I have added anything in the .emacs file?

No. The message that you saw is a message from Windows that indicates
that the command you have attempted to invoke, grep, can't be found in
the PATH environmental variable. The most likely explanation for the
problem is that the path to grep you entered into the PATH
environmental variable was subtly incorrect.

Robert,

Thanks, that narrows it down, if I re-install emacs I shall know where to
look.

Graham

Post by Robert Thorpe

Post by Graham Smith
Eli,
Thanks for your help.
I did restart Emacs, indeed I re-booted the PC. I modified the PATH via

My

Post by Graham Smith
Computer|advanced|Environmental variable, and I have re-installed Grep.
In the end I gave up and installed Emacsw32, which comes with Grep, and

its

Post by Graham Smith
now working.
I would rather have solved the problem but, for now this seems the more
efficient way of sorting it out.
Should I have added anything in the .emacs file?

No. The message that you saw is a message from Windows that indicates
that the command you have attempted to invoke, grep, can't be found in
the PATH environmental variable. The most likely explanation for the
problem is that the path to grep you entered into the PATH
environmental variable was subtly incorrect.
_______________________________________________
help-gnu-emacs mailing list
//lists.gnu.org/mailman/listinfo/help-gnu-emacs

Post by Graham Smith
Robert,
Thanks, that narrows it down, if I re-install emacs I shall know where to
look.

Some tips:-
* The path is needed exactly to the executable, in Cygwin for example
C:\cygwin\bin\
* The path must be separated by ";"s if a mistake is made in doing this
earlier in the path variable it propagates until the next ;
* A new path only goes into effect when you click OK in the dialog box.
Then it only goes into effect for new programs from that time. Ones
currently running are not affected.
* The environmental variables Window gives "system variables" and "user
variables". For most Emacs purpose this doesn't matter since Emacs
will be run as whatever user you are. But for some programs it matters
because they run sub-processes as system tasks.

Robert,

Thanks for this, I shall bear this in mind the next time I add a program to
the path. I am finding emacs a big learning experience.

Graham

Post by Robert Thorpe

Post by Graham Smith
Robert,
Thanks, that narrows it down, if I re-install emacs I shall know where

to

Some tips:-
* The path is needed exactly to the executable, in Cygwin for example
C:\cygwin\bin\
* The path must be separated by ";"s if a mistake is made in doing this
earlier in the path variable it propagates until the next ;
* A new path only goes into effect when you click OK in the dialog box.
Then it only goes into effect for new programs from that time. Ones
currently running are not affected.
* The environmental variables Window gives "system variables" and "user
variables". For most Emacs purpose this doesn't matter since Emacs
will be run as whatever user you are. But for some programs it matters
because they run sub-processes as system tasks.
_______________________________________________
help-gnu-emacs mailing list
//lists.gnu.org/mailman/listinfo/help-gnu-emacs

Date: 24 Jan 2007 06:25:27 -0800
Some tips:-
* The path is needed exactly to the executable
in Cygwin for example
C:\cygwin\bin\
* The environmental variables Window gives "system variables" and "user
variables". For most Emacs purpose this doesn't matter since Emacs
will be run as whatever user you are. But for some programs it matters
because they run sub-processes as system tasks.

It does matter if one uses the same machine under several user names,
or wants his aunt to use Emacs. In that case, modify the system-wide
Path; otherwise only for your username.

Just drop those on your c:\windows and never worry about that again...
:]
//unxutils.sourceforge.net/

The following program versions are covered:

bc-1.05
bison-1.28
bzip2-1.0.2
diffutils-2.7
fileutils-3.16
findutils-4.1
flex-2.5.4
gawk-3.1.0
grep-2.4.2
gsar110
gzip-1.2.4
indent-2.2.9
jwhois-2.4.1
less-340
m4-1.4
make-3.78.1
patch-2.5
recode-3.6
rman-3.0.7
sed-3.02
shellutils-1.9.4
tar-1.12
textutils-2.1
unrar-3.00
wget-1.8.2
which-2.4

Cheers,
HS

Post by Eli Zaretskii

Date: 24 Jan 2007 06:25:27 -0800
Some tips:-
in Cygwin for example
C:\cygwin\bin\
* The environmental variables Window gives "system variables" and "user
variables". For most Emacs purpose this doesn't matter since Emacs
will be run as whatever user you are. But for some programs it matters
because they run sub-processes as system tasks.It does matter if one uses the same machine under several user names,

or wants his aunt to use Emacs. In that case, modify the system-wide
Path; otherwise only for your username.

Date: 24 Jan 2007 12:51:53 -0800
Just drop those on your c:\windows and never worry about that again...
:]
//unxutils.sourceforge.net/

First, unxutils is a collection of very old versions of GNU software.
It also seems to not be maintained anymore.

And second, the directory you suggested does not need to exist on a
Windows system, it can have other names.

Post by Eli Zaretskii
And second, the directory you suggested does not need to exist on a
Windows system, it can have other names.

One can use %systemroot% for that. Of course, you need write access in
that dir.

/Mathias

Post by Eli Zaretskii

Date: 24 Jan 2007 12:51:53 -0800
Just drop those on your c:\windows and never worry about that again...
:]
//unxutils.sourceforge.net/

First, unxutils is a collection of very old versions of GNU software.
It also seems to not be maintained anymore.
And second, the directory you suggested does not need to exist on a
Windows system, it can have other names.

Third, is it really a good idea to place other binaries in this special
directory that is suppose to contain only the OS binaries?

On Jan 25, 8:50 am, "Lennart Borgman [gmail]"

Post by Lennart Borgman [gmail]

Post by Eli Zaretskii

Date: 24 Jan 2007 12:51:53 -0800
Just drop those on your c:\windows and never worry about that again...
:]
//unxutils.sourceforge.net/

First, unxutils is a collection of very old versions of GNU software.
It also seems to not be maintained anymore.
And second, the directory you suggested does not need to exist on a
Windows system, it can have other names.Third, is it really a good idea to place other binaries in this special

directory that is suppose to contain only the OS binaries?

It certainly isn't. And putting "find" their will probably interfer
with MS "find" as C:\Windows occurs earlier in PATH than MS find does.
This may break some batch files.

Post by Robert Thorpe

Post by Lennart Borgman [gmail]

Post by Eli Zaretskii
Windows system, it can have other names.Third, is it really a
good idea to place other binaries in this special

directory that is suppose to contain only the OS binaries?

It certainly isn't. And putting "find" their will probably interfer
with MS "find" as C:\Windows occurs earlier in PATH than MS find does.
This may break some batch files.

I have put exe files in c:\winnt and c:\windows for many years without
any problems. But I don't put all things there, of course.

Exactly what text did you add to the PATH variable? It should have been
the directory where grep was installed.

Matthew Flaschen

Post by Graham Smith
Eli,
Thanks for your help.
I did restart Emacs, indeed I re-booted the PC. I modified the PATH via My
Computer|advanced|Environmental variable, and I have re-installed Grep.
In the end I gave up and installed Emacsw32, which comes with Grep, and its
now working.
I would rather have solved the problem but, for now this seems the more
efficient way of sorting it out.
Should I have added anything in the .emacs file?
Graham

Date: Tue, 23 Jan 2007 22:27:35 +0000
I have installed Grep from the gnuwin32 web site and "now" added it to

the

PATH environmental variable. Same error.

Date: Wed, 24 Jan 2007 08:20:35 +0000
Should I have added anything in the .emacs file?

No, that shouldn't be necessary.

Eli,

Thanks, I now understand this isn't required.

Graham

Post by Eli Zaretskii

Date: Wed, 24 Jan 2007 08:20:35 +0000
Should I have added anything in the .emacs file?

No, that shouldn't be necessary.
_______________________________________________
help-gnu-emacs mailing list
//lists.gnu.org/mailman/listinfo/help-gnu-emacs

Post by Graham Smith
In emacs 22 on windows should grep work?
I am typing m-x grep which opens a line in the mini buffer that says
Run grep [like this]: grep -n
and a message saying: Grep started at Tue Jan 23 21:19:22
I then add, as shown in the grepmode wiki the following to the mini buffer
-e setq ~/.emacs
giving me a full line in the minibuffer of
Run grep [like this]: grep -n -e setq ~/.emacs
hit return and get a message that says
'grep' is not recognized as an internal or external command,
operable program or batch file.
Can anyone point out what I am doing wrong.
Many thanks,
Graham

Grep is not a native program with windows.

I installed the cygwin unix environment on my xp machine, and have
been successfully using the grep command from there for some time.

www.cygwin.com

- Chris McMahan

--
[. .]
=ooO=[_]=Ooo=====================================
Chris McMahan | ***@onedotnet
=================================================

Chris,

Thanks for the reply.

I have installed the GNUWin32 version of Grep

I assume this should work with Emacs :-[

Post by Graham Smith

Post by Graham Smith
In emacs 22 on windows should grep work?
I am typing m-x grep which opens a line in the mini buffer that says
Run grep [like this]: grep -n
and a message saying: Grep started at Tue Jan 23 21:19:22
I then add, as shown in the grepmode wiki the following to the mini

buffer

Post by Graham Smith
-e setq ~/.emacs
giving me a full line in the minibuffer of
Run grep [like this]: grep -n -e setq ~/.emacs
hit return and get a message that says
'grep' is not recognized as an internal or external command,
operable program or batch file.
Can anyone point out what I am doing wrong.
Many thanks,
Graham

Grep is not a native program with windows.
I installed the cygwin unix environment on my xp machine, and have
been successfully using the grep command from there for some time.
www.cygwin.com
- Chris McMahan
--
[. .]
=ooO=[_]=Ooo=====================================
=================================================
_______________________________________________
help-gnu-emacs mailing list
//lists.gnu.org/mailman/listinfo/help-gnu-emacs

Post by Chris McMahan

Post by Graham Smith
In emacs 22 on windows should grep work?
I am typing m-x grep which opens a line in the mini buffer that says
Run grep [like this]: grep -n
and a message saying: Grep started at Tue Jan 23 21:19:22
I then add, as shown in the grepmode wiki the following to the mini buffer
-e setq ~/.emacs
giving me a full line in the minibuffer of
Run grep [like this]: grep -n -e setq ~/.emacs
hit return and get a message that says
'grep' is not recognized as an internal or external command,
operable program or batch file.
Can anyone point out what I am doing wrong.
Many thanks,
GrahamGrep is not a native program with windows.

I installed the cygwin unix environment on my xp machine, and have
been successfully using the grep command from there for some time.
www.cygwin.com
- Chris McMahan
--
[. .]
=ooO=[_]=Ooo=====================================
=================================================

On a related note, [I also use cygwin's grep + emacs], when I use grep,
I cannot follow the grep hits to the files.

In the *grep* window, I try pressing C-` or Ret on the line containing
the grep hit, but I get the message "No grep hit here". The mode line
reads Grep:exit [matched]

Although the buffer is in grep mode it seems that none of the
keybindings are active [Ret, Tab, etc.]

Just in case that it may help, here is a sample output from grep:
-*- mode: grep; default-directory:
"d:/my-software-add-ons/my-IDL/Numerics/Calculus-like/" -*-
Grep started at Wed Jan 24 14:05:26

e:/cygwin-root/bin/grep.exe function *.pro NUL
DerivTabulated.pro:function
DerivTabulated,X,Y,UseAsinh=UseAsinh,_extra=_extra
DerivTabulated.pro:; functions calculates the derivative of the
tabulated data using
IntTab1DTrapzd.pro:function IntTab1DTrapzd,vx=vx,vy,vdx=vdx
IntTab1DTrapzd.pro:; provided a tabulated function y as function of x
[dimensions N], an
RunningIntegral.pro:function RunningIntegral,x,y,_extra=_extra
SplineDeriv.pro:function
SplineDerivScalar,vxtab,vytab,vy2a,xinterp,iBefore=iBefore
SplineDeriv.pro:function SplineDerivAtTabPoints,vxtab,vytab,vy2a
SplineDeriv.pro:function
SplineDeriv,vxtab,vytab,vy2a,xinterp,aiBefore=aiBefore, $
SplineDeriv.pro:; given the values of the tabulated function by vxtab
and vytab, and
SplineDeriv.pro:; the second derivatives calculated by spl_init, the
function returns
SplineDeriv.pro:; the derivative of the function at vxinterp
inttab2dtrapzd.pro:function
IntTab2DTrapzd,vx=vx,vy=vy,vdx=vdx,vdy=vdy,mz
inttab2dtrapzd.pro:; provided a tabulated function y as function of x
[dimensions N], an
splineintegral.pro:function
SplineIntegral,x,y,y2a,AtTabulatedPoints=AtTabulatedPoints, _extra =
rXtraKwds
splineintegral.pro:; is set, it returns the cumulative integral of the
function at the

Grep finished [matches found] at Wed Jan 24 14:05:28

Thanks,

Mirko

Post by Mirko
On a related note, [I also use cygwin's grep + emacs], when I use grep,
I cannot follow the grep hits to the files.
In the *grep* window, I try pressing C-` or Ret on the line containing
the grep hit, but I get the message "No grep hit here". The mode line
reads Grep:exit [matched]
Although the buffer is in grep mode it seems that none of the
keybindings are active [Ret, Tab, etc.]

Indeed, why don't the matched lines mention the line number? `M-x grep'
provides the -n option to the grep program by default so that its output
lines look like:

FILE:LINE NUMBER:TEXT

Post by Mirko
"d:/my-software-add-ons/my-IDL/Numerics/Calculus-like/" -*-
Grep started at Wed Jan 24 14:05:26
e:/cygwin-root/bin/grep.exe function *.pro NUL
DerivTabulated.pro:function
DerivTabulated,X,Y,UseAsinh=UseAsinh,_extra=_extra
DerivTabulated.pro:; functions calculates the derivative of the
tabulated data using
IntTab1DTrapzd.pro:function IntTab1DTrapzd,vx=vx,vy,vdx=vdx
IntTab1DTrapzd.pro:; provided a tabulated function y as function of x
[dimensions N], an
RunningIntegral.pro:function RunningIntegral,x,y,_extra=_extra
SplineDeriv.pro:function
SplineDerivScalar,vxtab,vytab,vy2a,xinterp,iBefore=iBefore
SplineDeriv.pro:function SplineDerivAtTabPoints,vxtab,vytab,vy2a
SplineDeriv.pro:function
SplineDeriv,vxtab,vytab,vy2a,xinterp,aiBefore=aiBefore, $
SplineDeriv.pro:; given the values of the tabulated function by vxtab
and vytab, and
SplineDeriv.pro:; the second derivatives calculated by spl_init, the
function returns
SplineDeriv.pro:; the derivative of the function at vxinterp
inttab2dtrapzd.pro:function
IntTab2DTrapzd,vx=vx,vy=vy,vdx=vdx,vdy=vdy,mz
inttab2dtrapzd.pro:; provided a tabulated function y as function of x
[dimensions N], an
splineintegral.pro:function
SplineIntegral,x,y,y2a,AtTabulatedPoints=AtTabulatedPoints, _extra =
rXtraKwds
splineintegral.pro:; is set, it returns the cumulative integral of the
function at the
Grep finished [matches found] at Wed Jan 24 14:05:28

--
Kevin Rodgers
Denver, Colorado, USA

Post by Kevin Rodgers

Post by Mirko
On a related note, [I also use cygwin's grep + emacs], when I use grep,
I cannot follow the grep hits to the files.
In the *grep* window, I try pressing C-` or Ret on the line containing
the grep hit, but I get the message "No grep hit here". The mode line
reads Grep:exit [matched]
Although the buffer is in grep mode it seems that none of the
keybindings are active [Ret, Tab, etc.]
Just in case that it may help, here is a sample output from grep:Indeed, why don't the matched lines mention the line number? `M-x grep'

provides the -n option to the grep program by default so that its output
FILE:LINE NUMBER:TEXT

Post by Mirko
"d:/my-software-add-ons/my-IDL/Numerics/Calculus-like/" -*-
Grep started at Wed Jan 24 14:05:26
e:/cygwin-root/bin/grep.exe function *.pro NUL
DerivTabulated.pro:function
DerivTabulated,X,Y,UseAsinh=UseAsinh,_extra=_extra
DerivTabulated.pro:; functions calculates the derivative of the
tabulated data using
IntTab1DTrapzd.pro:function IntTab1DTrapzd,vx=vx,vy,vdx=vdx
IntTab1DTrapzd.pro:; provided a tabulated function y as function of x
[dimensions N], an
RunningIntegral.pro:function RunningIntegral,x,y,_extra=_extra
SplineDeriv.pro:function
SplineDerivScalar,vxtab,vytab,vy2a,xinterp,iBefore=iBefore
SplineDeriv.pro:function SplineDerivAtTabPoints,vxtab,vytab,vy2a
SplineDeriv.pro:function
SplineDeriv,vxtab,vytab,vy2a,xinterp,aiBefore=aiBefore, $
SplineDeriv.pro:; given the values of the tabulated function by vxtab
and vytab, and
SplineDeriv.pro:; the second derivatives calculated by spl_init, the
function returns
SplineDeriv.pro:; the derivative of the function at vxinterp
inttab2dtrapzd.pro:function
IntTab2DTrapzd,vx=vx,vy=vy,vdx=vdx,vdy=vdy,mz
inttab2dtrapzd.pro:; provided a tabulated function y as function of x
[dimensions N], an
splineintegral.pro:function
SplineIntegral,x,y,y2a,AtTabulatedPoints=AtTabulatedPoints, _extra =
rXtraKwds
splineintegral.pro:; is set, it returns the cumulative integral of the
function at the
Grep finished [matches found] at Wed Jan 24 14:05:28--

Kevin Rodgers
Denver, Colorado, USA

Thank you Kevin!!!!!

Adding the -n option did the thing. I guess that in the mists of time,
I defined my grep command [in custom-set-variables] as
"e:/cygwin-root/bin/grep.exe". I have now added the -n switch to it.

Thanks again,

Mirko

Post by Graham Smith
In emacs 22 on windows should grep work?
I am typing m-x grep which opens a line in the mini buffer that says
Run grep [like this]: grep -n
and a message saying: Grep started at Tue Jan 23 21:19:22
I then add, as shown in the grepmode wiki the following to the mini buffer
-e setq ~/.emacs
giving me a full line in the minibuffer of
Run grep [like this]: grep -n -e setq ~/.emacs
hit return and get a message that says
'grep' is not recognized as an internal or external command,
operable program or batch file.
Can anyone point out what I am doing wrong.

As someone else has pointed out "grep" is not a native command on MS
Windows. To make it easier to setup Emacs on MS Windows I have therefor
added grep and some other unix style programs to EmacsW32, see

//ourcomments.org/Emacs/EmacsW32Util.html#featsum

Loading...

How do you fix is not recognized as an internal or external command operable program or batch file?

You can resolve this issue in three ways: First, use the full path of the executable file to launch the program. Second, add the program path to Windows environment variables. Finally, move the files to the System32 folder.

Is there a grep command for Windows?

In Windows PowerShell, the “Select-String” command is used as the equivalent to the grep command. Check out the use of the “Select-String” command by utilizing the provided examples in Windows PowerShell.

What is grep in shell script?

In Linux and Unix Systems Grep, short for “global regular expression print”, is a command used in searching and matching text files contained in the regular expressions.

What is not recognized as an internal and external command?

The “Python is not recognized as an internal or external command” error is encountered in the command prompt of Windows. The error is caused when Python's executable file is not found in an environment variable as a result of the Python command in the Windows command prompt.

Chủ Đề