运行 wsl 批处理脚本中的多个命令

Running multiple commands in a batch script for wsl

我有一个批处理脚本,用于在 Windows 登录时在 WSL 中启动 2 个机器人。

C:\Windows\System32\bash.exe -c "/home/roughnecks/go/bin/irchuu"
C:\Windows\System32\bash.exe -c "node /home/roughnecks/bots/Birba/birba.js"

我的问题是只有第一行运行,我猜是因为它在终端中输出内容并且 "birba.js" 不会触发,除非我 "ctrl-c" 在终端中退出 irchuu。

我已经尝试过不同的组合,例如使用 "nohup command &" 或 "command 2>&1 &",但没有任何效果如预期,我需要帮助。

谢谢

Windows bash 好像不支持 & fork一个命令然后继续。 从这个 Windows-related question START /B 中建议似乎有效:

START /B C:\Windows\System32\bash.exe -c "/home/roughnecks/go/bin/irchuu"
C:\Windows\System32\bash.exe -c "node /home/roughnecks/bots/Birba/birba.js"