7

I was trying to make some scripts dynamic by including the environment variable $LOGNAME and even $HOME. but it don't seem to work when placed in a launcher.

I am trying to make code a bit more dynamic

/home/simon/Desktop/firefox_test.bash

I tried

$HOME/Desktop/firefox_test.bash 

and

/home/$LOGNAME/Desktop/firefox_test.html

but it don't seem to read the environment variables.

1 Answer 1

10

Starter commands usually aren't evaluated by a shell so environment variable don't get evaluated.

Use

 sh -c '$HOME/Desktop/firefox_test.bash'

or

 sh -c 'xdg-open /home/$LOGNAME/Desktop/firefox_test.html'
1
  • haha.. that did it. @FlorianDiesch thanks for the answer
    – chip
    May 19, 2012 at 3:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.