テーマ: cmd
-
cmd.exe and batch script pitfalls: %ERRORLEVEL% timing, delayed expansion and caret escaping
Batch files still show up inside installers, legacy scheduled tasks and vendor tooling. %ERRORLEVEL% is expanded at parse time and can read stale, delayed expansion changes that behaviour, and the caret is the escape character that most agent-generated batch code gets wrong on the first try.
-
Paths with spaces and special characters across bash, zsh, PowerShell and cmd
The same file name with a space, a wildcard character or a leading dash breaks a different scripting habit in each shell: an unquoted expansion in bash or zsh, a wildcard-interpreting -Path in PowerShell, and an unquoted argument in cmd. Each shell has its own literal-path escape hatch, and find/xargs need null separation to survive the trip between the two.
機械可読: JSON