Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windowsBash tool #3474

Closed
emadhajjar opened this issue Aug 16, 2018 · 2 comments
Closed

windowsBash tool #3474

emadhajjar opened this issue Aug 16, 2018 · 2 comments

Comments

@emadhajjar
Copy link

emadhajjar commented Aug 16, 2018

Hello,

Today I have create a simple shell file that allow us to execute all available commands in Bash from cmd or Powershell...

https://github.com/aleppos/windowsBash

The idea is simple, just create a shortcut for all commands inside windows

windowsPath=/mnt/c/windowsBash/
mkdir -p "$windowsPath"
for entry in /usr/bin/* /bin/*
do
  if [ -f "$entry" ];then
    filename=$(basename "$entry")
    #echo "$entry"
    echo @echo off > "$windowsPath""$filename".bat
    echo bash -c \""$filename" %*\" >> "$windowsPath""$filename".bat
    if [[ ( $filename == "apt-get" ) || (  $filename == "apt" ) || ( $filename == "npm" ) ||  ( $filename == "yarn" ) ]];then
      echo bash -c \"windowsBash\" >> "$windowsPath""$filename".bat
    fi
  fi
done

windowsBash

This tool will allow you to use Bash commands inside Windows.

How to install

Run the following command inside Windows Bash to generate shortcuts for commands

wget https://raw.githubusercontent.com/aleppos/windowsBash/master/windowsBash -P /usr/bin && chmod 0777 /usr/bin/windowsBash && windowsBash

Then just add the following directory to your path in Windows

  • C:\windowsBash

When you want to update the commands list just run the Shell file again

windowsBash
@benhillis
Copy link
Member

Looks interesting. I'd suggest using wsl.exe instead of bash.exe though.

@therealkenc
Copy link
Collaborator

I was thinking of something along these lines a while back when #1823 was raised. I looked for around 10 minutes (literally extent of the effort) to see what kind of extensibility cmd.exe might offer to implement what amounts to Bash alias, but didn't find much. It is tempting to ask for such a thing as a cmd.exe feature, but that's kind of a PowerShell death march, isn't it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants