Batch file ';输入';在这个时候是出人意料的
这是我希望它能完美运行的代码:Batch file ';输入';在这个时候是出人意料的,batch-file,cmd,Batch File,Cmd,这是我希望它能完美运行的代码: @echo off echo.BASIC LANGUAGE COMPILER :start set available=0 set /p input="> " for /F %%a in ("%input%") do set mainline=%%a findstr /ri /c:"^ *:%mainline% " /c:"^ *:%input%$" "%~f0" >nul 2>nul && set available=1 ech
@echo off
echo.BASIC LANGUAGE COMPILER
:start
set available=0
set /p input="> "
for /F %%a in ("%input%") do set mainline=%%a
findstr /ri /c:"^ *:%mainline% " /c:"^ *:%input%$" "%~f0" >nul 2>nul && set available=1
echo available : %available%
if %available%==1 (call :%input%) else (echo ERROR 001 : UNAVAILABLE LINE)
set input=
set available=
goto :start
:echo
echo %1 %2 %3
goto :start
:cls
cls
goto :start
但不管我做了什么,它只是在呼应:
错误001:线路不可用
即使我输入了echo hi
我能做什么?问题在哪里
/c:"^ *:%mainline% "
标签的末尾可以有空格,也可以没有空格
.... /c:"^ *:%mainline% " /c:"^ *:%mainline%$" ....
非常感谢!我的基本环境现在设置好了;我现在可以专注于函数了@谢谢!