Windows Scripting Commands Not Recognized
-
22-03-2021 - |
문제
I am trying to run a cmd file but I am receiving strange errors. I am running this:
#!/bin/ksh
#@echo off
#REM *************************************************************************
...
...
But the results are returned with errors like so:
C:>#!/bin/ksh
'#!' is not recognized as an internal or external command,
operable program or batch file.
C:>#@echo off
'#@echo' is not recognized as an internal or external command,
operable program or batch file.
C:>#REM *************************************************************************
'#REM' is not recognized as an internal or external command,
operable program or batch file.
I have tried this on two computers with the same results. Can any one tell me why this is happening?
해결책
This is a ksh
script, launch it though ksh
(or any shell like bash
, sh
, csh
or tcsh
which understand the #!
line) and not the windows command line. You may need to install cygwin
(with ksh
), start a cygwin terminal and launch your script from there.
제휴하지 않습니다 StackOverflow