Execute Shell Commands from Program running in WIN

2019-03-15 08:20发布

I have a windows program running on Linux using WINE.

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

标签: linux shell wine
9条回答
Evening l夕情丶
2楼-- · 2019-03-15 09:06

I love the Far Commander, which does run under wine, so I set up these two scripts:

  1. To launch Linux applications from windows

C:\windows\xt.bat

start /unix /usr/bin/xterm -e %*
  1. To open files in Linux from the wine environment (Far):

C:\windows\xdg.bat

cd >C:\windows\command\mypwd
start /unix /etc/init.d/winopen.sh  %*

/etc/init.d/winopen.sh

#!/bin/sh
PWDF=`winepath -u 'C:\windows\command\mypwd'`
fromdos $PWDF
xdg-open $(winepath -u $(cat $PWDF)/$1)

Now I can type on the Far command line:

xt top

xdg SomeDocument.PDF

and get results in the Linux environment.

查看更多
Ridiculous、
3楼-- · 2019-03-15 09:08

Try (where yourprogram is the linux/unix program you want to execute in wine)

ln -s /path/to/yourprogram /path/to/wineprefix/drive_c/windows/system32/yourprogram

That is how I have gotten java working.

查看更多
贼婆χ
4楼-- · 2019-03-15 09:16

The shell script that was listed on WineHQ FAQ can be slightly modified, eg like this:

#!/bin/bash
WFILE=$(echo -E $2)
FILE=$(wine winepath $WFILE)
$1 $FILE

The rest works just as described in the FAQ.

查看更多
登录 后发表回答