0

In my .bash_profile, I have a line to start tmux only if it is present on the system with:

[ -z $TMUX ] && export TERM=xterm-256color && exec tmux 

In a similar vein, I would like to skip or include certain lines:

• Have certain lines in my .bash_profile that only run during a tmux session start.

• Have certain lines in my .bash_profile that do not run during a tmux session start.

What would the syntax be to achieve this?

1 Answer 1

0

It's wrong because -z will return true if the environment variable have an empty value. So you have to use instead :

[ ! -z $TMUX ] && export TERM=xterm-256color && exec tmux 

Where the exclamation (!) mark negate the conditional test.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.