← 教程列表
coding

The Problem

📅 2026/6/12 16:30:02⏱ 约 5 分钟阅读👁 8 阅读

Claude Code runs hook commands through the system's default shell: - **Windows**: CMD.exe - **macOS/Linux**: bash or sh This creates several challenges: 1. **Script execution**: Windows CMD can't execute `.sh` files directly - it tries to open them in a text editor 2. **Path format**: Windows uses backslashes (`C:\path`), Unix uses forward slashes (`/path`) 3. **Environment variables**: `$VAR` syntax doesn't work in CMD 4. **No `bash` in PATH**: Even with Git Bash installed, `bash` isn't in the PATH when CMD runs

← 返回教程列表 AI8899 · 内容仅供学习参考