openSUSE Forums > Programming/Scripting » launch a program asyncronously with a shell script

Go Back   openSUSE Forums > Programming/Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read


Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 22-Oct-2009, 20:36
Puzzled Penguin
 
Join Date: Oct 2009
Posts: 3
pjdeets2 hasn't been rated much yet
Default launch a program asyncronously with a shell script

Hello, I wrote a shell script to launch KeePass. It's very simple:

cd /home/philip/bin/KeePass
mono KeePass.exe

I have two problems though.

1) When I click on the script on my desktop, it launches a text editor to edit it instead of running the script. Also, whenever it gets opened in a text editor, the executable bit gets unset.
2) If I run the script from a console, the script doesn't return me back to the prompt until I close KeePass.

Can you tell me how to overcome these issues?

Thanks
Reply With Quote
  #2 (permalink)  
Old 22-Oct-2009, 21:01
malcolmlewis's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: Podunk
Posts: 4,704
malcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputation
Default Re: launch a program asyncronously with a shell script

Quote:
Originally Posted by pjdeets2
Hello, I wrote a shell script to launch KeePass. It's very simple:

cd /home/philip/bin/KeePass
mono KeePass.exe

I have two problems though.

1) When I click on the script on my desktop, it launches a text editor
to edit it instead of running the script. Also, whenever it gets opened
in a text editor, the executable bit gets unset.
2) If I run the script from a console, the script doesn't return me
back to the prompt until I close KeePass.

Can you tell me how to overcome these issues?

Thanks
Hi
Why not install the one from the mono community or contrib repositories?
http://software.opensuse.org/search?...&p=1&q=keepass

Then you should be able to just add to autostart, or if using gnome,
right-click and add to startup prorams.

If your executing something, use ampersand and then exit command to
close the shell if you want eg;
Code:
some_program &
exit
--
Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.29-0.1-default
up 13 days 8:26, 3 users, load average: 0.38, 0.31, 0.30
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18

Reply With Quote
  #3 (permalink)  
Old 22-Oct-2009, 21:05
Global Moderator
 
Join Date: Jul 2008
Location: Salt Lake City, Utah
Posts: 1,252
hendersj 's reputation will be famous soon enoughhendersj 's reputation will be famous soon enoughhendersj 's reputation will be famous soon enough
Default Re: launch a program asyncronously with a shell script

On Fri, 23 Oct 2009 01:46:01 +0000, pjdeets2 wrote:

> Hello, I wrote a shell script to launch KeePass. It's very simple:
>
> cd /home/philip/bin/KeePass
> mono KeePass.exe
>
> I have two problems though.
>
> 1) When I click on the script on my desktop, it launches a text editor
> to edit it instead of running the script. Also, whenever it gets opened
> in a text editor, the executable bit gets unset. 2) If I run the script
> from a console, the script doesn't return me back to the prompt until I
> close KeePass.
>
> Can you tell me how to overcome these issues?
>
> Thanks


In addition to Malcom's suggestions, I would add the line:

#!/bin/bash

to the start of the script.

Jim
--
Jim Henderson
openSUSE Forums Moderator
Reply With Quote
Reply

Bookmarks


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
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2