VOGONS


First post, by curvedline

User metadata
Rank Newbie
Rank
Newbie
@echo off
cls

echo 1 2 3 4 | find "2"
if errorlevel 1 goto :a1
if not errorlevel 1 goto :a2

:a1
echo string not found
goto :end1

:a2
echo string found
goto :end1
:end1

echo 1 2 3 4 | find "5"
if errorlevel 1 goto :a3
if not errorlevel 1 goto :a4

:a3
echo string not found
goto :end

:a4
echo string found
goto :end

:end
pause

this command was either broken or dosbox was not meant to implement this, both results were the same, when they could NOT be the same.
it works in dosbox-x well.

if it wasnt meant for dosbox to implement this, dosbox should have given an error message, but it looked like dosbox was processing it as if it was rightfully working.

this one is hurting badly when there are not many DOS commands to work with in dosbox.

find "abc" aa1.txt, this natural FIND command in dosbox was not implemented from the start, it caused an immediate syntax error, which i understood

i think i got nothing to use for finding

i checked these commands, no working in dosbox
echo %~d0 - understandable if not working
echo %~dp0 - understandable if not working
echo %~p0 - understandable if not working
echo %0 except for this
echo %1 except for this
echo %CD%
echo %__CD__%

FOR %%v IN (aa bb cc) DO echo %%v - this one also hurts

Reply 1 of 2, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie

DOSBox doesn't handle pipes/redirection. If you want that to work you have to boot a real MSDOS disk image instead of using the built-in shell.

Reply 2 of 2, by curvedline

User metadata
Rank Newbie
Rank
Newbie

when i noticed the find command was not implemented in dosbox, i should have stopped poking around other "find" possibilities, in a desperate moment i forgot about it
ok it was not a bug, i just lost my mind.

if "find" command is not implemented, then
is there a way to return a filesize to tell apart the differences so that dosbox's "if and errorlevel" statement can have a control, if the editable files have the same filesizes, then i will add a string like "abc" to one of them to make them different

if peek and poke can do this, please send me to that direction
if external utilities can pass the filesize variables to a batch file, please send me to that direction