Adding parameters.

Questions about Wine on Linux
Locked
Ashboy
Level 2
Level 2
Posts: 21
Joined: Fri May 10, 2013 3:29 pm

Adding parameters.

Post by Ashboy »

Hi there. Having a bit of a problem with a small Windows program that requires some extra parameters to be fed to it. It works fine in Windows, but in Linux it confuses command shell, I think. It splits it up in smaller bits and assumes they are seperate commands.

This is the exact line:

Code: Select all

wine MOD144.exe [ --mins | --form CGRID.exe | CGRID.exe ]
There can be no variations after the .exe, it needs to be exactly like this or it won't work. Is there any way to achive this in the terminal shell?
Ashboy
Level 2
Level 2
Posts: 21
Joined: Fri May 10, 2013 3:29 pm

Re: Adding parameters.

Post by Ashboy »

Eh.. not that it matters, but the last two .exe's needed to be .wav's. Sorry. Can't seem to spot an edit button.
lahmbi5678
Level 7
Level 7
Posts: 823
Joined: Thu Aug 27, 2009 6:23 am

Re: Adding parameters.

Post by lahmbi5678 »

Hi,

there's some ambiguosity in your post. Is that command line really a concrete example or some kind of general pattern, it looks like a regular expression (showing all the allowed possibilities)? I'm quite sure, that "[", "]" shouldn't be part of a concrete DOS command.

Please run a concrete example and post the terminal output including the command.
Ashboy
Level 2
Level 2
Posts: 21
Joined: Fri May 10, 2013 3:29 pm

Re: Adding parameters.

Post by Ashboy »

This isn't about dos commands. This is simply how this program works, I didn't design it. I've used it many times before, just not in a linux terminal.
lahmbi5678
Level 7
Level 7
Posts: 823
Joined: Thu Aug 27, 2009 6:23 am

Re: Adding parameters.

Post by lahmbi5678 »

Again, please run a sample command and post its output. It's still unclear to me, if the
"[ --mins | --form CGRID.exe | CGRID.exe ]" part is stating the general syntax of MOD144.exe (allowed options etc), or if it is part of a concrete command line, that you actually try to issue. In the later case, the "[" and "]" and "|" do have some meaning in a linux shell, but won't work that way, which might be part of the problem. You could try to put it into quotation marks, like
wine MOD144.exe "[ --mins | --form CGRID.exe | CGRID.exe ]"

Alternatively you can try "wine cmd", which would give you a dos command prompt. Then run "MOD144.exe" from there.

If it's a pure dos program, you could even try DOSBox.
Ashboy
Level 2
Level 2
Posts: 21
Joined: Fri May 10, 2013 3:29 pm

Re: Adding parameters.

Post by Ashboy »

It's the syntax of MOD144. It doesn't work because as you say, it means something else in Linux. I understand that very well. I tried DOSBox already, but it won't accepted it as the executable was made for Windows.

I'll give wine cmd a shot.. should circumvent the linux synstax.
Ashboy
Level 2
Level 2
Posts: 21
Joined: Fri May 10, 2013 3:29 pm

Re: Adding parameters.

Post by Ashboy »

Yep that did the trick. Thanks so much, I've been struggling with this for three evenings.
lahmbi5678
Level 7
Level 7
Posts: 823
Joined: Thu Aug 27, 2009 6:23 am

Re: Adding parameters.

Post by lahmbi5678 »

Nice to hear, that it works for you. This kind of syntax is plain wrong(tm), they shouldn't use it.

If you are still willing to experiment, try escaping (putting a \ in front of problematic special characters):
wine MOD144.exe \[ --mins \| --form CGRID.exe \| CGRID.exe \]
This will tell the linux shell to not evaluate the special characters.

Alternatively single quoting might work (double quoting still evaluates the pipes ("|"), didn't think of it):
wine MOD144.exe '[ --mins | --form CGRID.exe | CGRID.exe ]'

I had to look up the details too, when googling I found a quite useful page, see
http://wiki.bash-hackers.org/syntax/quoting
Ashboy
Level 2
Level 2
Posts: 21
Joined: Fri May 10, 2013 3:29 pm

Re: Adding parameters.

Post by Ashboy »

Thanks! I do aim to learn more. :)
Locked