Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


I tried




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

share|improve this question
up vote 5 down vote accepted

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


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


 sh -c 'xdg-open /home/$LOGNAME/Desktop/firefox_test.html'
share|improve this answer
haha.. that did it. @FlorianDiesch thanks for the answer – niccolo m. May 19 '12 at 3:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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