Run SH/shell-script in Win10

Setup

Install Windows Subsystem for Linux (WSL)

  1. Settings -> Turn Windows features on or off -> check on Windows Subsystem for Linux -> Reboot.
  2. If has error Windows Subsystem for Linux has no installed distributions, run in cmd

    1
    lxrun /install

    Note: in Windows 10 1803 and later, lxrun is deprecated, will need to install it via Windows App Store following the link showing on the screen.

Run

Run cmd sh file folder

1
bash xxx.sh