Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

In ~/.profile I run a script in the background (redshift for changing the screen temperature at night time).

After logging in, I can open a terminal, and run tmux.

However, at this point, redshift visibly gets interrupted as the screen temperature resets and it seems that redshift starts again in this terminal.

What's happening here? I get the impression that ~/.profile is for each shell, and gets parsed again when I run tmux. Could this be?

share|improve this question
up vote 4 down vote accepted

As explained in 6.2 Bash Startup Files, ~/.profile is executed when you start an interactive login shell (or use the --login option). Since tmux's default behavior is to start a login shell in each new window, your profile is being executed again.

Probably the simplest thing to do is change your script to determine whether redshift is running, and start it only if necessary.

share|improve this answer
Thanks, and just for the record I edited my script as shown here. – eoinoc Feb 26 '12 at 13:42

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.