access shell from programs run with wine

View: New views
11 Messages — Rating Filter:   Alert me  

access shell from programs run with wine

by DaVince :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am running programs in wine that allow you to access  shell commands from windows such as mkdir and cd etc... When I am using wine, where is this going to go?  

In particular, I am doing some ray tracing using OSLO EDU using ccl rpogramming. I cannot figure out how to make a new directory to store stuff but can (in windows) escape to the shell to use the mkdir as "exec_shellcmd("mkdir c:\newdir", 0)". I would like to do this under wine, but simply doing this didn't work - any ideas?

Ali






Re: access shell from programs run with wine

by DaVince :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can use DOS commands in your Windows program - wineconsole and the wine cmd implementation should pick them up.

But since it didn't work... I dunno? Maybe Windows' mkdir conflicts with Linux's mkdir...






Re: access shell from programs run with wine

by DaVince :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

maybe, I really wasn't sure where the escape from the windows program would go and wasn't sure if the wine cmd would simply get them. It would be nice to know if you could escape to linux from within a wine program.






Re: access shell from programs run with wine

by DaVince :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

One thing,  you should check: Is the string "mkdir c:\newdir" really working? Shouldn' it read "mkdir c:\\newdir" in your c/c++ program? You probably need to escape the "\", which otherwise would be interpreted as newline aka "\n" in that string. Does that mkdir stuff in your program work under windows?






Re: access shell from programs run with wine

by DaVince :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, I misread your original post or didn't exactly understand what you are trying to do.

Do you want to get a linux console to create a new directory manually?
From where are you trying to exectute that exec_shellcmd? Probably from some script interpreter inside that software? If yes, which script language is it, something like perl, python or some proprietary language?






Re: access shell from programs run with wine

by DaVince :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


alimuir wrote:
> maybe, I really wasn't sure where the escape from the windows program would go and wasn't sure if the wine cmd would simply get them. It would be nice to know if you could escape to linux from within a wine program.

Well, you can enter UNIX paths to have Linux apps run from Wine. See http://wiki.winehq.org/FAQ#head-68d921c50355f280a905e3574b7dda58d76ff51f






Re: access shell from programs run with wine

by DaVince :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for all your help. Although I was sure it was doing what I thought in Windows proper last night, in checking I cannot make it work in windows either today - perhaps it didn't last night either and I got it wrong. Still interesting though.

To answer further though, the language the program uses is a form of c, however I have also tried to include direct.h in the program scripts but they didn't want to compile - I guess the language isn't quite the same as c. In particular I do not think it can use pointers.

Although this does not work it would be interesting to know what would happen in other programs such as matlab that also let you acces the shell the program i running in.

Thanks again for all the replies.

Ali






Re: access shell from programs run with wine

by James E. Lang-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

--On Thursday, November 12, 2009 05:41:54 AM -0600 alimuir
<wineforum-user@...> wrote:

> Hi,
>
> I am running programs in wine that allow you to access  shell commands from
> windows such as mkdir and cd etc... When I am using wine, where is this going
> to go?
>
> In particular, I am doing some ray tracing using OSLO EDU using ccl
> rpogramming. I cannot figure out how to make a new directory to store stuff
> but can (in windows) escape to the shell to use the mkdir as
> "exec_shellcmd("mkdir c:\newdir", 0)". I would like to do this under wine,
> but simply doing this didn't work - any ideas?

I don't think that what I have is exactly what you want but here it is anyway
in case it contains something that is of assistance. I use Pegasus Mail for
some e-mail processing. I wanted it to be able to use Kate (the KDE advanced
text editor) for processing temporary file copies of certain attachments. The
mechanism that it used to specify an external text editor got the Windows style
path to a temporary file mangled when done on Linux via Wine so I created the
following script which works like a charm:

#!/bin/bash

kate $(echo "${1}" | sed \
  -e 's+[cC]:\\+'$HOME'\/\.wine\/drive_c\/+' \
  -e 's+\\+/+g')

I then specified that it be invoked by means of /home/myuser/scripts/katebridge
with the argument being the Windows style address (including path) of the
temporary file.

--
Jim


Re: access shell from programs run with wine

by DaVince :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


jelang wrote:
> the following script which works like a charm:
> #!/bin/bash
>
> kate $(echo "${1}" | sed \
> -e 's+[cC]:\\+'$HOME'\/\.wine\/drive_c\/+' \
> -e 's+\\+/+g')

RTFM my friend. Wine has 'winepath' program for that. Which actually works in all cases. http://wiki.winehq.org/winepath






Re: access shell from programs run with wine

by James E. Lang-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

--On Friday, November 13, 2009 12:10:30 AM -0600 vitamin
<wineforum-user@...> wrote:

>
> jelang wrote:
>> the following script which works like a charm:
>> # !/bin/bash
>>
>> kate $(echo "${1}" | sed \
>> -e 's+[cC]:\\+'$HOME'\/\.wine\/drive_c\/+' \
>> -e 's+\\+/+g')
>
> RTFM my friend. Wine has 'winepath' program for that. Which actually works in
> all cases. http://wiki.winehq.org/winepath

Thank you Ma'am. I was unaware of that tool's existence. I am not sure how it
would be used to invoke a program with a Linux style path passing it a data
file with a Windows style path.

--
Jim


Re: access shell from programs run with wine

by DaVince :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


jelang wrote:
> I am not sure how it  would be used to invoke a program with a Linux style path passing it a data file with a Windows style path.

Something like this:
http://wiki.winehq.org/FAQ#head-e03d797155ac6e9d8176f045acbdeebc28ad33d4