Can t run bash on windows 10
Download PC Repair Tool to quickly find & fix Windows errors automatically Shell Scripts or .SH files are like batch files of Windows which can be executed in Linux or Unix. It is possible to run .sh or
Shell Script file in Windows 10 using Windows Subsystem for Linux. In this post, we will show you how to run a Shell Script file in Windows 11/10. Bash is a Unix shell and command language which can run Shell Script files. You do not need to install Ubuntu or any other Linux Distros unless your scripts need the support of the real Linux kernel. We will share both the methods. Install WSL or Windows Subsystem for Linux Go to Settings > Update & Security > For Developers. Check the Developer Mode radio button. And search for “Windows Features”, choose “Turn Windows features on or
off”. Scroll to find WSL, check the box, and then install it. Once done, one has to reboot to finish installing the requested changes. Press Restart now. BASH will be available in the Command Prompt and PowerShell. Execute Shell Script Files On a Linux platform, you usually use SH, but here you need to use BASH. That said, BASH in Windows has its limitations, so if you want to execute in a Linux environment, you need to install Ubuntu or anything similar. 2] Execute Shell Script using Ubuntu on Windows 11/10Make sure you 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 be available at /mnt/c/users/ Now follow these steps
It will execute the script, and if they have a dependency on any of the core Linux features. Since Linux is now available in Windows, you need not use any third-party applications like Cygwin. WSL should be enough for most of the scenarios to help you run a shell script in Windows 11/10. How do I create a .SH file?The steps to create a shell script file are:
Can you run shell scripts in Windows?Yes, now with Bash Shell in Windows 11 and Windows 10, you can now create and run Bash shell scripts and incorporate Bash commands into a Windows batch file or PowerShell script. Ashish is a veteran Windows and Xbox user who excels in writing tips, tricks, and features on it to improve your day-to-day experience with your devices. He has been a Microsoft MVP (2008-2010). So, I've been using the new(ish) Bash on Ubuntu on Windows (WSL) for a while now and all has been top-notch, until yesterday. I git-pushed from Bash by accident, so it asked me for my repo-destination account details like normal. I decided to ignore this, terminate Bash and try to just use powershell instead (can't ever remember passwords!). Terminating Bash however caused the shell to freeze. I forced closed and restarted my comp (I've had to force close and restart several times before for various reasons and everything was fine). After boot up, I just tried to check if Bash was working again, but it wasn't. It just failed to start with no error message. For example:
Has anyone else had a similar situation/knows how to help? EDIT: Only solved through reinstalling bash, using
then
asked May 18, 2017 at 13:26
oblongoblong 5752 gold badges5 silver badges8 bronze badges 2 I had the same issue but my solution was different. I found that my (Default) WSL distribution was set to docker-desktop-data instead of my Ubuntu distribution, e.g. In PowerShell (Windows Shell): This lists WSL distributions. For me "docker-desktop-data (Default)" was listed as default not my Ubuntu distribution. To change this: In PowerShell (Windows Shell):
David Buck 3,61934 gold badges31 silver badges35 bronze badges answered Jun 25, 2020 at 17:46
MarkMark 5214 silver badges2 bronze badges 4 Came here with a similar issue, but a different solution, so I'll post in case it helps anyone else. The difference in my situation was that, when running
Now it should work either by launching the standalone app, or typing This and other causes can be found in this Github issue. answered Sep 11, 2017 at 1:19
Dave SDave S 7881 gold badge12 silver badges30 bronze badges 1 The solutions listed also did not work for me. I found a solution here. Essentially, navigate to answered Sep 30, 2018 at 5:19
Robert YiRobert Yi 1,1771 gold badge11 silver badges18 bronze badges 3 Do a FULL REBOOT. That worked for me. Windows 10 fast boots system to save memory. TO do a Full Reboot Hold Shift and Click on Restart/Shutdown. answered May 5, 2020 at 10:21
0 I've had similar issues. The solution for me was to disable fast startup in powers settings. answered Jun 11, 2019 at 23:03
0 Linux Distribution should be installed additionally to Windows Subsystem for Linux. See Install WSL on Windows 10 or Install WSL on Windows Server for detailed steps and explanations. In case mentioned manuals are moved or not available I'll put below main steps for Windows 10 that helped me:
answered Apr 15, 2019 at 9:49
1 I had the same issue the following fix worked for me: Fix:
answered Apr 23, 2020 at 14:28
See my comment to original poster. Your fix did not work for me. here is the PowerShell [as admin] listing: Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved.
I went to https://aka.ms/wslstore
Ubuntu [window]:
Please note: BUMMER! None of my shortcuts or installs were moved over from my last version. Here i am running BASH from vscode:
At least it works. answered May 26, 2018 at 19:29
4 Right after Windows Updates KBB4471324 and a reboot, Bash wouldn't launch. No messages. In event viewer I saw messages about
I didn't bother trying to figure out if the SID, CLSID and APPID were associated with bash. I launched Bash as administrator, which worked, and then bash as a normal user, which worked. It seems to be fine, now. answered Dec 15, 2018 at 21:54
Section i: other error messages.
Section ii: verify your installation and restart.Be sure that WSL (Windows Subsystem Linux) is checked/installed and your computer had a proper restart: {⊞START} → type " Section 1a: Install Linux [via the Microsoft Store].
Section 1b: Side-load Linux.*This is a placeholder--you can manually install WLS--https://learn.microsoft.com/en-us/windows/wsl/install-manual. I have not done this, yet. If you have done this, please add instructions by editing my answer; otherwise, I will post this section after performing this operation myself. Section 2: if launching Ubuntu throws 'WslRegisterDistribution failed with error: 0x80070057'**After installing a linux flavor:
**This is the most-accepted solution for this issue is the last answer on page two at Microsoft Answers. answered Jan 4, 2020 at 20:42
Wolfpack'08Wolfpack'08 3,81810 gold badges45 silver badges78 bronze badges What worked for me was to disable and enable WSL feature from control panel:
answered May 6, 2021 at 10:24
OrozcoOrozco 3352 silver badges8 bronze badges If none of the previuos answers worked for you, try this workaround, after trying different alternatives, this one worked for me.
answered May 8, 2021 at 17:02
Why is Bash not running on Windows 10?This error occurs due to the “Windows Subsystem for Linux” not running on the C drive, which is Windows's system drive. To address this issue, ensure that your Linux system is installed in the C drive.
Why does Bash not work on Windows?If the build version is less than 14393, you will not be able to install Bash. To enable Bash on a supported build, you should first turn on Developer Mode. To do so, head over to Settings, click on For Developers and select the Developer Mode radio button.
Why is my Bash not working?In short, look for the following to fix “ bash: bashtop: command not found “: Make sure the shell PATH variable correctly set and verify your PATH environment variable. Verify that the file you want to execute or run exists on the Unix or Linux box. Some commands need to run as the superuser (root user).
How to install Bash shell in Windows 10?What to Know. Developer Mode: Right-click Start menu > select Settings > Update & Security > For developers.. Next: Select Developer mode > Yes > enable Windows Subsystem For Linux > restart.. Use bash: Right-click Start menu > select Windows PowerShell (Admin) > type "bash" > press Enter.. |