Results 1 to 2 of 2

Thread: Can't source script in launcher script

  1. #1
    Join Date
    Jun 2009
    Beans
    12

    Can't source script in launcher script

    I've got a script, "setup", that sets some environment variables. I have another script, "launch", that launches a program for me. A launcher on my menu panel is set to run command "launch".

    Here's what the text of "launch" looks like:

    source setup
    export FOO=$VAR_FROM_SETUP
    gui-program

    If I run this from the launcher, the program sees an empty string for FOO. If I run it from a terminal, the program sees a correct value for FOO.

    Why the discrepancy? Is there a workaround that will allow a launcher to set variables via "setup" before running my program?

  2. #2
    Join Date
    Jun 2009
    Beans
    12

    Re: Can't source script in launcher script

    Solved by forcing the script to launch under bash (doesn't work under sh, apparently):

    #!/bin/bash
    source setup
    export FOO=$VAR_FROM_SETUP
    gui-program

Bookmarks

Posting Permissions

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