How To Run .sh File In Windows
Vanquish Scripts or .SH files are like batch files of Windows which tin be executed in Linux or Unix. It is possible to run .sh or Shell Script file in Windows ten using Windows Subsystem for Linux. In this post, nosotros will show you how to run a Beat Script file in Windows 11/10.
How to run .sh or Shell Script file in Windows 11/x
Bash is a Unix beat and command language which can run Shell Script files. You exercise non need to install Ubuntu or whatever other Linux Distros unless your scripts demand the back up of the existent Linux kernel. We will share both the methods.
- Execute Shell Script file using WSL
- Execute Trounce Script using Ubuntu on Windows 10
i] Execute Trounce Script file using WSL
Install WSL or Windows Subsystem for Linux
Go to Settings > Update & Security > For Developers. Check theDeveloper Mode radio push. And search for "Windows Features", choose "Plough Windows features on or off".
Scroll to notice WSL, check the box, and then install it. Once done, one has to reboot to end installing the requested changes. Press Restart now. BASH will be available in the Control Prompt and PowerShell.
Execute Shell Script Files
- Open Command Prompt and navigate to the folder where the script file is bachelor.
- Type Fustigate script-filename.sh and striking the enter key.
- It volition execute the script, and depending on the file, you lot should see an output.
On a Linux platform, y'all usually use SH, simply hither you need to apply Fustigate. That said, Bash in Windows has its limitations, so if you want to execute in a Linux surroundings, you demand to install Ubuntu or anything similar.
two] Execute Shell Script using Ubuntu on Windows ten
Make sure you lot have Ubuntu or any other Linux distros installed. Ubuntu will mount or make all your Windows directories available under /mnt. So the C drive is available at /mnt/C. So if the desktop will exist available at /mnt/c/users/<username>/desktop.
Now follow these steps
- Type Fustigate in run prompt, and it will launch the distro prompt.
- Navigate to the folder using "cd" control to the folder where the scripts are available.
- Type "sh script.sh" and hit enter.
It will execute the script, and if they have a dependency on any of core Linux features.
Since Linux is now available in Windows, you need not use whatsoever tertiary party applications like Cygwin. WSL should exist enough for most of the scenarios to assist y'all run a shell script in Windows x.
How To Run .sh File In Windows,
Source: https://www.thewindowsclub.com/how-to-run-sh-or-shell-script-file-in-windows-10
Posted by: mooreadezvot.blogspot.com

0 Response to "How To Run .sh File In Windows"
Post a Comment