Reputation: 77
When starting my shell, I get a message :" 'echo.' is not recognized as an internal or external command, operable program or batch file." I am not sure where it comes from. The problem is, that when I run my perl scripts as external tools in eclipse, this message is also printed in the eclipse console after the output of the scripts. How can I get rid of it?
Upvotes: 1
Views: 3590
Reputation: 35175
Since this is the top search hit when searching for the error message: one can also end up with this intermittent error message when the current directory contains a file named echo
, even if it's empty. It's easy to diagnose this possibility: move to another directory and check if echo.
works. It should normally print an empty line in cmd, where echo
is a built-in command. If echo.
works in other directories: rename or remove the file called echo
.
Upvotes: 0
Reputation: 69
Barbara Jensen provided the best answer in a comment (quoted below)
Echo. in Windows CMD should print a blank line, but in some situations, it returns the "is not recognized as an internal or external command..." error. I suspect it's cmdextensions or similar.
Barbara says "echo/" replaces it and this worked perfectly for me. Thanks B.
echo. is supposed to display a blank line; it is not invalid Windows command. I have used this in batch files for at least 15y and it went bad for me very recently. Interestingly for me, its working sometimes (the windows that I've set up for compiling) and not others (fresh ones). If I change the echo. to echo/ in my batch files, they work again. – Barbara Jensen Feb 14 at 13:55
Upvotes: 2
Reputation: 2868
Remove the . at the end of echo. command used in the perl script.
To locate the perl script involved in a directory and all sub directories, use:
grep -irH "echo[.]" .
This other command-line below automatically update all perl scripts found in current directory and sub directories; it replaces any echo. encountered with echo
WARNING: backup the directory before running the command-line below:
find . -type f -print0 | xargs -0 -I xxxx sed -i 's/echo[.]/echo/g' xxxx
Upvotes: 1