Author Topic: shell script to .exe?  (Read 4708 times)

Offline billy7720

  • Full Member
  • ***
  • Posts: 222
  • DBGL = DosBox Game Launcher! Games coming!
shell script to .exe?
« on: September 22, 2011, 07:37:11 PM »
I haven't figured out how to do this but does someone know how to make a shell script run as an EXE file? I'm TRYING to finish a laptop for a kid's birthday present and would like her just to be able to click on a single shell script and have it run another program. Any ideas? I'm bewildered.

Also, I have Openbox Bonsai "mini" which has very secretly moved the top section bar out of the screen. I can't for the life of me figure this one out. Where did the darned thing go?

Thanks for ANY help. It's appreciated.

Sincerely;
billy7720
MY LAPTOP:
DUAL BOOT Windows XP/PCLinuxOS KDE 2011:
hp ze4900 - Intel 1.4 GHz Celeron M - 2 GB RAM - 1024x768 graphics - 60 GB Hitachi Travelstar HD
Oldie but goodie! Runs PCLinuxOS PERFECT!
PCLinuxOS: Radically Simple, graphically superior!

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8583
  • Aurum nostrum non est aurum vulgi.
Re: shell script to .exe?
« Reply #1 on: September 22, 2011, 07:47:07 PM »
[user@localhost ~] $ chmod a+x location_of/script.sh
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline billy7720

  • Full Member
  • ***
  • Posts: 222
  • DBGL = DosBox Game Launcher! Games coming!
Re: shell script to .exe?
« Reply #2 on: September 22, 2011, 07:53:47 PM »
[user@localhost ~] $ chmod a+x location_of/script.sh

????

Thanks Archie but I can't understand Latin. Could you please exemplify a bit further? Thanks.
MY LAPTOP:
DUAL BOOT Windows XP/PCLinuxOS KDE 2011:
hp ze4900 - Intel 1.4 GHz Celeron M - 2 GB RAM - 1024x768 graphics - 60 GB Hitachi Travelstar HD
Oldie but goodie! Runs PCLinuxOS PERFECT!
PCLinuxOS: Radically Simple, graphically superior!

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8583
  • Aurum nostrum non est aurum vulgi.
Re: shell script to .exe?
« Reply #3 on: September 22, 2011, 07:56:34 PM »
Sorry.

For example, your script is on your Desktop and it is called script.sh ...

Open a terminal, and type in the command,

chmod a+x Desktop/script.sh

and you should be able to just click the script on your desktop to run whatever it is you wanted it to do.
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline muungwana

  • Hero Member
  • *****
  • Posts: 6204
Re: shell script to .exe?
« Reply #4 on: September 22, 2011, 07:57:05 PM »
what are the contents of the script? or what command would you like the script to run?
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline billy7720

  • Full Member
  • ***
  • Posts: 222
  • DBGL = DosBox Game Launcher! Games coming!
Re: shell script to .exe?
« Reply #5 on: September 22, 2011, 07:59:42 PM »
Thanks guys. Sorry about that as I'm new to the "Latin" form of language ;)

I'm trying to make a shell script (already written) turn into an EXE file so a child can click on it to run a program.

Nothing more. I just want her to be able to click on it and DBGL will run (Dosbox game launcher) so her
learning games will run on her "new" laptop for her birthday. :)

Amazingly, PCLinuxOS 2010 has no issues with a single click to launch DBGL. It works on my system because it has 2GB of memory but her laptop has 256mb of RAM. So I used "openbox" and configured it to run with very little on screen. At her age all she needs this machine for is some older dos learning games but DBGL's shell script refused to run - I had to install Dosbox through the repos to get DBGL to run. It does. But now I would like to make the DBGL shell script (start file) run with a single click.

That's all there really is to it.
« Last Edit: September 22, 2011, 08:09:40 PM by billy7720 »
MY LAPTOP:
DUAL BOOT Windows XP/PCLinuxOS KDE 2011:
hp ze4900 - Intel 1.4 GHz Celeron M - 2 GB RAM - 1024x768 graphics - 60 GB Hitachi Travelstar HD
Oldie but goodie! Runs PCLinuxOS PERFECT!
PCLinuxOS: Radically Simple, graphically superior!

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6204
Re: shell script to .exe?
« Reply #6 on: September 22, 2011, 08:03:06 PM »

"exe" means "executable" a shell script is a script, meaning it is an executable file. A shell script does not have to be turned to an exe since it already is.

If you can not click on it to run its contents then you are either doing something wrong with its contents or the script does not have permission to run or the programs in them are not GUI programs.

We have to know its contents to make sure you have its contents right.
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline billy7720

  • Full Member
  • ***
  • Posts: 222
  • DBGL = DosBox Game Launcher! Games coming!
Re: shell script to .exe?
« Reply #7 on: September 22, 2011, 08:04:54 PM »

"exe" means "executable" a shell script is a script, meaning it is an executable file. A shell script does not have to be turned to an exe since it already is.

If you can not click on it to run its contents then you are either doing something wrong with its contents or the script does not have permission to run or the programs in them are not GUI programs.

We have to know its contents to make sure you have its contents right.

What is happening is once I double click on DBGL shell script, is openbox then asks a menu of choices. I then click on "execute file" and it runs. This is silly. I want it to run WITHOUT clicking on that rediculous "execute file" choice or have the menu pop up. That's all I really need.

I learned something new today: shell scripts ARE EXE files in Linux. Wonderful! Nice to know this stuff ;)
« Last Edit: September 22, 2011, 08:07:54 PM by billy7720 »
MY LAPTOP:
DUAL BOOT Windows XP/PCLinuxOS KDE 2011:
hp ze4900 - Intel 1.4 GHz Celeron M - 2 GB RAM - 1024x768 graphics - 60 GB Hitachi Travelstar HD
Oldie but goodie! Runs PCLinuxOS PERFECT!
PCLinuxOS: Radically Simple, graphically superior!

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8583
  • Aurum nostrum non est aurum vulgi.
Re: shell script to .exe?
« Reply #8 on: September 22, 2011, 08:09:31 PM »
billy7720, first of all yours is not really a complicated request. But to be more certain of what the effect will be, perhaps it would be good if you can copy and paste the content of the script so we can determine if it can indeed run your desired effect.
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline muungwana

  • Hero Member
  • *****
  • Posts: 6204
Re: shell script to .exe?
« Reply #9 on: September 22, 2011, 08:10:17 PM »

"exe" means "executable" a shell script is a script, meaning it is an executable file. A shell script does not have to be turned to an exe since it already is.

If you can not click on it to run its contents then you are either doing something wrong with its contents or the script does not have permission to run or the programs in them are not GUI programs.

We have to know its contents to make sure you have its contents right.

What is happening is once I double click on DBGL shell script, is openbox then asks a menu of choices. I then click on "execute file" and it runs. This is silly. I want it to run WITHOUT clicking on that rediculous "execute file" choice or have the menu pop up. That's all I really need.

I learned something new today: shell scripts ARE EXE files in Linux. Wonderful! Nice to know this stuff ;)

ok, so the problem is with openbox's file manager's handling of scripts. YOu should have said this in your first post. I dont use open box or its file manager. Hope somebody who does will come and show you how to change the behavior.
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline billy7720

  • Full Member
  • ***
  • Posts: 222
  • DBGL = DosBox Game Launcher! Games coming!
Re: shell script to .exe?
« Reply #10 on: September 22, 2011, 08:14:57 PM »


ok, so the problem is with openbox's file manager's handling of scripts. YOu should have said this in your first post. I dont use open box or its file manager. Hope somebody who does will come and show you how to change the behavior.
[/quote]

Thanks! Sorry about that. I have no idea how to change that stuff. Thanks again.

Yes, I just want Openbox to run a shell script with a single click and NOT have a silly menu with four choices come up. That's about the gist of it.
« Last Edit: September 22, 2011, 08:20:09 PM by billy7720 »
MY LAPTOP:
DUAL BOOT Windows XP/PCLinuxOS KDE 2011:
hp ze4900 - Intel 1.4 GHz Celeron M - 2 GB RAM - 1024x768 graphics - 60 GB Hitachi Travelstar HD
Oldie but goodie! Runs PCLinuxOS PERFECT!
PCLinuxOS: Radically Simple, graphically superior!

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8583
  • Aurum nostrum non est aurum vulgi.
Re: shell script to .exe?
« Reply #11 on: September 22, 2011, 08:21:56 PM »
I believe the script is already executable. Your problem is not the script but suppressing the window that pops up asking four questions.

i don't use OB as well but this issue is not specific to the OB.

The java handles the menu of games available so unless you have one specific game you wanted to launch then I'm afraid you're stuck with the menu.
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8583
  • Aurum nostrum non est aurum vulgi.
Re: shell script to .exe?
« Reply #12 on: September 22, 2011, 08:24:31 PM »
How about you open a terminal and run the menu script and leave the terminal open so you can see exactly what it does related to your choices on the menu. In one of the lines on the terminal will be the command you'll need to run that ONE particular game and I think that is what you need. Four scripts/commands to run each of the four games.
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline Taco.22

  • Sr. Member
  • ****
  • Posts: 481
Re: shell script to .exe?
« Reply #13 on: September 22, 2011, 10:11:49 PM »
If all you want to do is make a desktop launch icon for an installed  program, then all you need to do is make a copy of its .desktop file found in/usr/share/applications in the Desktop folder in the file manager.  You have pcmanfm as file manager, and it supports desktop icons.  You don't have to be root to do this.

Go to /usr/share/applications/app.desktop, right click and "copy".  Then open the Desktop folder in your home folder and right click "paste".  The icon will appear on your desktop and you can move it to where you want.  There are command line options, but this is very simple and straight forward.  You can set other icon launchers as well.

You are NOT doing this as root, so you can't stuff anything up :D.

Linux Registered User # 529407


Offline Rudge

  • Hero Member
  • *****
  • Posts: 9662
  • I'm Just A Dog.
Re: shell script to .exe?
« Reply #14 on: September 22, 2011, 10:19:26 PM »
If all you want to do is make a desktop launch icon for an installed  program, then all you need to do is make a copy of its .desktop file found in/usr/share/applications in the Desktop folder in the file manager.  You have pcmanfm as file manager, and it supports desktop icons.  You don't have to be root to do this.

Go to /usr/share/applications/app.desktop, right click and "copy".  Then open the Desktop folder in your home folder and right click "paste".  The icon will appear on your desktop and you can move it to where you want.  There are command line options, but this is very simple and straight forward.  You can set other icon launchers as well.

You are NOT doing this as root, so you can't stuff anything up :D.



Hi Taco.22.

I don't think the op is having a problem launching the program from the desktop.

It's what the program does after it launches that needs to be modified.

At least this is the way I am reading it. Maybe this will shed some light if I am correct.
« Last Edit: September 22, 2011, 10:30:08 PM by Rudge »


-If you wish to make an apple pie from scratch, you must first invent the universe-  Carl Sagan