My installer uses <addDirectoryToPath>. On Linux (Ubuntu/Debian), it adds entries to both the $HOME/.bashrc and $HOME/.profile files. However, my $HOME/.profile file includes the following code:

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"

As a result, my new path is added to the $PATH two times and my path looks like this:


Considering all the different flavors of Linux, isn't there a better way to update the $PATH without appending it twice?

asked 05 Jul '12, 00:02

tahoar's gravatar image

accept rate: 42%

It is not currently possible to avoid that. InstallBuilder adds the defined PATH to both scripts to make sure it is always available. In any case, just duplicating the value once should not cause any issue.


answered 09 Jul '12, 10:51

juanjo's gravatar image

juanjo ♦♦
accept rate: 23%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 05 Jul '12, 00:02

Seen: 1,089 times

Last updated: 09 Jul '12, 10:51