How to Execute Shell Script Files on Finestre 10 Using WSL.
Bash is a Unix shell and command language which can run Shell Script files.
- Execute Shell Script file using WSL
- Execute Shell Script using Ubuntu SU Finestre 10
Execute Shell Script file using WSL
Install WSL or Windows Subsystem for Linux
1. Go to Settings\Update & Security\For Developers. Check the Developer Mode;
2. Cercare Finestre Feature, and choose to Turn Finestre features on or off;
3. Scroll to find WSL, check the box, and then install it;
4. Reboot to finish installing the requested changes;
5. BASH will be available in the Prompt dei comandi E PowerShell.
Execute Shell Script Files
1. Aprire Windows PowerShell and navigate to the folder where the script file is available;
2. Type:
It will execute the script, and depending on the file, you should see an output.
On a Linux platform, you usually use SH, but here you need to use BASH.
Execute Shell Script using Ubuntu in dual-boot
Make sure you have Ubuntu or any other Linux distros installed on the target PC in dual-boot with Finestre 10. Ubuntu will mount or make all your Finestre directories available under /mnt. So the C:\ drive is available at /mnt/C.
Now follow these steps:
- Type Bash in a run prompt, and it will launch the distro prompt.
- Navigate to the folder using the cd command to the folder where the scripts are available.
- Type sh script.sh and hit enter.
This is false, to use bash like this you NEED to have linux distribution installed