Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute Shell Commands from Program running in WINE

Tags:

linux

shell

wine

I have a windows program running on Linux using WINE.

How can I call Linux shell commands from the windows program?

like image 675
UKnoHowWeDo Avatar asked May 14 '11 18:05

UKnoHowWeDo


2 Answers

With newer Wine versions (tested with Wine 1.7.38), you can run a Linux program from within Wine in the following way (here to launch gedit, as an example):

wineconsole cmd

...and from that wine console:

start /unix /usr/bin/gedit

If you want to launch a Linux program directly from within a Windows-application, the following line did work for me:

cmd /c start /unix /usr/bin/gedit

To test this, you can call directly on your Linux console this:

wine cmd /c start /unix /usr/bin/gedit

One important thing to Note: the program you want to start needs to have the executable bit set, otherwise calling it from Wine will fail!

like image 103
Adrian Avatar answered Sep 21 '22 12:09

Adrian


Try this (runs Gnome calculator on my Linux Mint system):

wineconsole cmd

...and from the wine console:

/bin/sh gcalctool

On this general principle, you can also open documents and associate files with a linux app by editing the wine registry. There is a section about it in the wine FAQ:

6.6.3 How do I associate a native program with a file type in Wine?

So you should be able to write shell scripts and call them OK.

like image 39
Psen Avatar answered Sep 20 '22 12:09

Psen