I have this useful batch script named lxss.cmd
added to my PATH:
::@ECHO OFF
@ECHO ON
set arg1=%*
"C:\Windows\System32\bash.exe" -c "%arg1%"
Which is outputting:
User@LANTI-DESKTOP C:\Users\User
$ lxss lsb_release -a && uname -a
User@LANTI-DESKTOP C:\Users\User
$ set arg1=lsb_release -a
User@LANTI-DESKTOP C:\Users\User
$ "C:\Windows\System32\bash.exe" -c "lsb_release -a"
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
MSYS_NT-10.0 LANTI-DESKTOP 2.6.1(0.305/5/3) 2017-01-25 00:01 x86_64 Msys
As you can see, the uname -a
command left from this execution, but instead run by MSYS2 which is also presented in my PATH. Probably the &&
command also handled by MSYS2. But this won't be a problem if set arg1=lsb_release -a
line would be containing && uname -a
also.
My expected output that I want to achieve:
User@LANTI-DESKTOP C:\Users\User
$ "C:\Windows\System32\bash.exe" -c "lsb_release -a && uname -a"
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
Linux LANTI-DESKTOP 3.4.0+ #1 PREEMPT Thu Aug 1 17:06:05 CST 2013 x86_64 x86_64 x86_64 GNU/Linux
I found the %*
variable here, but looks like &&
terminating the readout. Is there a way to achieve what I want?
Edit:
As reading here the Windows and Linux &&
command basically doing the same thing.
So I edited slightly my script: "C:\Windows\System32\bash.exe" -c %*
And now I executing with this command: lxss "lsb_release -a && uname -a"
Which is works, but would be much nicer with less typing and look as linux like as possible. Any ideas?