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"
    fi
fi

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

/home/user/domy-2.5/bin:/home/user/domy-2.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

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

tahoar
201313236
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.

link

answered 09 Jul '12, 10:51

juanjo's gravatar image

juanjo ♦♦
5.8k413
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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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

Tags:

×27

Asked: 05 Jul '12, 00:02

Seen: 1,046 times

Last updated: 09 Jul '12, 10:51