Can WB Shell out to Bash

Started by stanl, January 27, 2018, 03:25:15 AM

Previous topic - Next topic

stanl


td

Making an assumption or two about the meaning of the term "shell out" and if you happen to have a fully updated version of Windows 10 with Microsoft's bash shell enabled, the following works:

Code (winbatch) Select
Run('C:\Windows\sysnative\bash.exe', '~')
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

stanl

Quote from: td on January 29, 2018, 07:16:56 AM
Making an assumption or two about the meaning of the term "shell out" and if you happen to have a fully updated version of Windows 10 with Microsoft's bash shell enabled, the following works:

Code (winbatch) Select
Run('C:\Windows\sysnative\bash.exe', '~')


and this would run VI?
Code (WINBATCH) Select

Run('C:\Windows\sysnative\bash.exe', '-c "vi"')

td

I still have unpleasant dreams about writing vi tutorials for undergrads...

It more or less works that way since it's Linux.  You could save a couple of keystrokes by dropping the double quotes.

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

Oooh!!  Oooh!!! Oooh!!!  I love vi.   I use it for most all my development work.   I use Lemmy.   While a bit limited on file sizes it will handle it is much better than Vim.

Jim

stanl

Quote from: td on January 29, 2018, 01:36:58 PM

It more or less works that way since it's Linux.

Thanks. Now from a quick read it appears [again if set up right] windows files can be accessed from  /mnt/c in bash and with Powershell now cross-platform a PS script could be executed. If so, is it a possibility that WB could execute from Bash then recover results from Windows files affected (if you catch my meaning, if you get my drift). 

td

WinBatch is a Windows application.  You need WINE to run it on pure Linux.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

Note that you need the Linux PowerShell Core runtime and Core framework to execute Powershell scripts in a Linux environment.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

I take it back.  It is possible to execute Windows applications from the bash shell prompt on Windows 10.  The tricky bit is getting the permissions right and escaping all the special characters in the path.  However, a Windows desktop application started from a bash shell prompt is still running on Windows, in a Windows environment, and on the Windows desktop.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade