Results 1 to 3 of 3

Thread: launch a program asyncronously with a shell script

  1. #1
    pjdeets2 NNTP User

    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

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,339
    Blog Entries
    15

    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


  3. #3
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,317

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •