Hello! I try to write Batch script similar to Bash one (open in Repl.it):
I've written it:
, but this variant doesn't work with following error:
Bash:
function f()
{
read foo
echo "$foo"
}
echo "arg" | f
Code:
@echo off
echo arg|call :f
pause
@echo on
@goto :eof
:f
set /p foo=""
echo %foo%
exit /b 0
:eof
What's wrong with it?Invalid attempt to call batch label outside batch script.
Last edited: