Go Back   Forums > Abandonia.com > Troubleshooting > General compatibility fixes
Memberlist Forum Rules Search Today's Posts Mark Forums Read
Search Forums:
Click here to use Advanced Search

Reply
 
Thread Tools Display Modes
Old 03-09-2012, 11:34 PM   #1
jonnan001
Newbie
 
jonnan001's Avatar

 
Join Date: Sep 2012
Location: ,
Posts: 6
Default Linux Dosbox Trick

I'm fairly pleased with myself for figuring this out, and since I can't find anywhere on the Internet it mentions this, I'm posting it for people.

There is a Linux feature (intended for running scripts in an interpreter) called hashbang or shebang. Basically, if you have a text script that uses '#' to denote comments, in linux you can mark the script executable and put "#! /path/to/script-interpreter" as the first line, and when linux runs it it will use that interpreter.

Since DOSBox .conf files use #comments, it works perfectly well with DOSbox.
Thus:
#!/usr/bin/dosbox -conf
(configuration)
(end-of-file)

Configuration/Caveats

Where is dosbox installed?
From the command-line, type "whereis dosbox".

Permissions:
File needs to be marked 'executable'.

end-of-line character:
*has* to be linefeed (e.g. Unix), *not* carriage-return/linefeed (e.g. MS-DOS/Windows);
It will fail silently if it has the latter, but this can be fixed with a unix utility called 'dos2unix'. usage: dos2unix ~/bin/*
(This caught me offguard when porting gog.com games in, and I felt really stupid when I figured out why the exact same configuration was fine in one file, but just opened DOSBox in another - <G>.)

File Naming:
They do not need the .conf extension, and if you intend to open them via double clicking, they can be named anything. However if you want to run them from the command line, they need to be in a location Linux see's in your $PATH (ideally ~/bin/), and you probably want to avoid a name containing spaces: typing moo2 will work, typing "Master of Orion 2" will work but you actually need the quotes, clicking on the file "Master of Orion 2" with no quotes will work fine though.

I probably shouldn't be as annoyingly pleased with myself over this that I am . . . but hey, it's really quite nice and easy and loads stuff better than my previous system of manually adding games to gnome menus.

Jonnan
__________________
When life hands you Lemons, make Lemonade.
When life hands you the Pits, make Nerve Gas!
jonnan001 is offline                         Send a private message to jonnan001
Reply With Quote
Old 04-09-2012, 08:35 PM   #2
Japo
Autonomous human
 
Japo's Avatar


 
Join Date: Mar 2006
Location: ,
Posts: 4,613
Default

Thanks, this is pretty good
__________________
Life starts every day anew. Prospects not so good...
Japo is offline                         Send a private message to Japo
Reply With Quote
Old 05-09-2012, 07:37 AM   #3
jonnan001
Newbie
 
jonnan001's Avatar

 
Join Date: Sep 2012
Location: ,
Posts: 6
Default

Quote:
Originally Posted by Japo View Post
Thanks, this is pretty good
Thanks - as I said, what I had been doing was manually adding games to the menus, which is not hard one at a time but is a pain en masse. It was just one of those odd thoughts as I was updating GoG.com conf files where your brain goes "Come to think . . . is there any reason that wouldn't work? I can't see why not, right?"

To be fair, this is still a pain en masse, but considerably less of one, and I prefer the end result over having it in the menus anyway.

Pug
__________________
When life hands you Lemons, make Lemonade.
When life hands you the Pits, make Nerve Gas!
jonnan001 is offline                         Send a private message to jonnan001
Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
A little trick when looking for something on Mobygames... The Fifth Horseman Gaming Zone 2 28-04-2012 05:49 PM
Hat Trick Romano Games Discussion 2 05-12-2007 05:21 PM
Dosbox + Linux + Krynn Games = ? newbie sarah Troubleshooting 4 28-09-2006 10:01 PM
Dosbox In Linux Sebatianos Troubleshooting 1 01-04-2006 02:45 AM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump
 


The current time is 02:04 AM (GMT)

 
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.