http://qs1969.pair.com?node_id=11155721


in reply to "exit 1" and "exit(1)" are apparently not the same

I can't find any documentation that explains this differing behaviour.

This is the documentation for exit (as produced by help exit):

Quits the CMD.EXE program (command interpreter) or the current batch script. EXIT [/B] [exitCode] /B specifies to exit the current batch script instead of CMD.EXE. If executed from outside a batch script, it will quit CMD.EXE exitCode specifies a numeric number. if /B is specified, sets ERRORLEVEL that number. If quitting CMD.EXE, sets the p +rocess exit code with that number.

The bevahiour of exit(1) isn't defined, and there's no reason to believe it's valid. (It's no like you can do echo(foo) or perl(file.pl), and exit(1) is no different.) You provided garbage, and received garbage in return (GIGO).