Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i Add the export path for swift into ./profile on ubuntu 15.10

Tags:

linux

swift

Single use:

 export PATH = $ PATH:/home/raul/swift/usr/ bin

but When the terminal restarts the configuration is lost but in the ~/.profile the same line is not working u.u

like image 573
Lagul Avatar asked Mar 13 '23 21:03

Lagul


1 Answers

The code below can be added to the end of .profile. Review to make sure there are no spaces the path strings /home/raul/swift/usr/bin and PATH="$PATH:/home/raul/swift/usr/bin".

## :MY:PROFILE:EDIT: add swift executable path
if [ -d "/home/raul/swift/usr/bin" ] ; then
    PATH="$PATH:/home/raul/swift/usr/bin"
fi

After .profile is edited, do one to the following for the changes to take affect:

  • source .profile
  • logout and re-login to the desktop session
  • restart the machine

Note: .profile would be effective to the duration of the desktop login session and for subsequent terminal sessions within the same desktop session. .bashrc would typically apply just to the scope of a terminal session.

like image 68
l --marc l Avatar answered Mar 16 '23 09:03

l --marc l