Announcement

Collapse
No announcement yet.

Resolving path setting in ~/.profile file

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Resolving path setting in ~/.profile file


    There is a line in
    Code:
    ~/.profile
    which is

    Code:
    PATH="$HOME/bin:$HOME/.local/bin:$PATH"i
    I don't know about the last "i".

    Should I remove it or is it a syntax error?

  • #2
    It seems to be a syntax error, the actual .profile should look like below unless you changed things around (this is the 17.10 version, see notes below it):
    Code:
    # ~/.profile: executed by the command interpreter for login shells.
    # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
    # exists.
    # see /usr/share/doc/bash/examples/startup-files for examples.
    # the files are located in the bash-doc package.
    
    # the default umask is set in /etc/profile; for setting the umask
    # for ssh logins, install and configure the libpam-umask package.
    #umask 022
    
    # if running bash
    if [ -n "$BASH_VERSION" ]; then
        # include .bashrc if it exists
        if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
        fi
    fi
    
    # set PATH so it includes user's private bin if it exists
    if [ -d "$HOME/bin" ] ; then
        PATH="$HOME/bin:$PATH"
    fi
    This is the result in Ubuntu 17.10 version while in the older version of Ubuntu, they check if the users bin directory is present was not included into the .profile. Easiest way to check how it should look like is by viewing at /etc/skel/.profile.

    Simply place this at the end of your profile file:

    Code:
    # Manual addition for swift development snapshot
    export PATH="$PATH:/home/jeremy/swift-4.0-DEVELOPMENT-SNAPSHOT-2017-06-29-a-ubuntu16.04/usr/bin"
    If you ever mess up your profile completely, there is a copy where you can get a new one from in /etc/skel/.

    Comment

    Working...
    X