Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Setting "export PATH=/usr/bin:/bin" permnently

  1. #11
    Join Date
    Jul 2007
    Location
    Poland
    Beans
    4,499
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Setting "export PATH=/usr/bin:/bin" permnently

    i think you missed $ sign before PATH. PATH without $ is a literal string and you have it at the end, while $PATH would take the value of the variable and append it after your custom android sdk directory
    /home/chandu/Documents/Old system files/Downloads/android-sdk-linux_x86/platform-tools/:/usr/bin:/bin:PATH

    example using echo
    Code:
    echo /some/dir:PATH
    /some/dir:PATH
    
    echo /some/dir:$PATH
    /some/dir:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

  2. #12
    Join Date
    May 2011
    Location
    sweden
    Beans
    20
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Setting "export PATH=/usr/bin:/bin" permnently

    Quote Originally Posted by Vaphell View Post
    i think you missed $ sign before PATH. PATH without $ is a literal string and you have it at the end, while $PATH would take the value of the variable and append it after your custom android sdk directory
    /home/chandu/Documents/Old system files/Downloads/android-sdk-linux_x86/platform-tools/:/usr/bin:/bin:PATH

    example using echo
    Code:
    echo /some/dir:PATH
    /some/dir:PATH
    
    echo /some/dir:$PATH
    /some/dir:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
    Hi
    I appreciate for your help .
    Thank you very much

    In bashrc file I removed /usr/bin:/bin and added $ symbol before PATH
    my new PATH in bashrc file
    PATH=/home/chandu/Documents/Old\ system\ files/Downloads/android-sdk-linux_x86/platform-tools/:$PATH
    Now it's working and everything perfect...

  3. #13
    Join Date
    Aug 2011
    Beans
    23

    Re: Setting "export PATH=/usr/bin:/bin" permnently

    but for me it doesnt work
    my ~/.profile
    Code:
     export ENV=$HOME/.setup  #set and export ENV variable
          export PATH=$PATH:$HOME:  #set and export PATH variable
          export EDITOR=ed          #set and export EDITOR variable
          export PS1='$LOGNAME':'$PWD':' >'
    PATH=/bin
    PATH=/usr/bin
    /etc/prolile
    Code:
    # /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
    # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
    
    if [ -d /etc/profile.d ]; then
    for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
    . $i
    fi
    done
    unset i
    fi
    
    if [ "$PS1" ]; then
    if [ "$BASH" ]; then
    PS1='u@h:w$ '
    if [ -f /etc/bash.bashrc ]; then
    . /etc/bash.bashrc
    fi
    else
    if [ "`id -u`" -eq 0 ]; then
    PS1='# '
    else
    PS1='$ '
    fi
    fi
    fi
    
    umask 022
    PATH=/usr/bin
    PT5HOME=/opt/pt
    export PT5HOME
    /etc/enviroment
    Code:
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
    LANG="ru_RU.utf8"
    ~/.bashrc
    Code:
    # ~/.bashrc: executed by bash(1) for non-login shells.
    # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
    # for examples
    
    # If not running interactively, don't do anything
    [ -z "$PS1" ] && return
    
    # don't put duplicate lines in the history. See bash(1) for more options
    # ... or force ignoredups and ignorespace
    HISTCONTROL=ignoredups:ignorespace
    
    # append to the history file, don't overwrite it
    shopt -s histappend
    
    # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
    HISTSIZE=1000
    HISTFILESIZE=2000
    
    # check the window size after each command and, if necessary,
    # update the values of LINES and COLUMNS.
    shopt -s checkwinsize
    
    # make less more friendly for non-text input files, see lesspipe(1)
    [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
    
    # set variable identifying the chroot you work in (used in the prompt below)
    if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
        debian_chroot=$(cat /etc/debian_chroot)
    fi
    
    # set a fancy prompt (non-color, unless we know we "want" color)
    case "$TERM" in
        xterm-color) color_prompt=yes;;
    esac
    
    # uncomment for a colored prompt, if the terminal has the capability; turned
    # off by default to not distract the user: the focus in a terminal window
    # should be on the output of commands, not on the prompt
    #force_color_prompt=yes
    
    if [ -n "$force_color_prompt" ]; then
        if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
    	# We have color support; assume it's compliant with Ecma-48
    	# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
    	# a case would tend to support setf rather than setaf.)
    	color_prompt=yes
        else
    	color_prompt=
        fi
    fi
    
    if [ "$color_prompt" = yes ]; then
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
    else
        PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    fi
    unset color_prompt force_color_prompt
    
    # If this is an xterm set the title to user@host:dir
    case "$TERM" in
    xterm*|rxvt*)
        PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
        ;;
    *)
        ;;
    esac
    
    # enable color support of ls and also add handy aliases
    if [ -x /usr/bin/dircolors ]; then
        test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
        alias ls='ls --color=auto'
        #alias dir='dir --color=auto'
        #alias vdir='vdir --color=auto'
    
        alias grep='grep --color=auto'
        alias fgrep='fgrep --color=auto'
        alias egrep='egrep --color=auto'
    fi
    
    # some more ls aliases
    alias ll='ls -alF'
    alias la='ls -A'
    alias l='ls -CF'
    
    # Add an "alert" alias for long running commands.  Use like so:
    #   sleep 10; alert
    alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
    
    # Alias definitions.
    # You may want to put all your additions into a separate file like
    # ~/.bash_aliases, instead of adding them here directly.
    # See /usr/share/doc/bash-doc/examples in the bash-doc package.
    
    if [ -f ~/.bash_aliases ]; then
        . ~/.bash_aliases
    fi
    
    # enable programmable completion features (you don't need to enable
    # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
    # sources /etc/bash.bashrc).
    if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
        . /etc/bash_completion
    fi
    its all works if i type in console
    Code:
    export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
    BUT if i open new terminal - i have errors

    comand 'uname' is in '/bin/uname'
    command cannot be found, cause '/bin' is not in PATH variable
    uname: command not found
    bash: [: =:
    command 'sed' is in '/bin/sed'
    command cannot be found, cause '/bin' is not in PATH variable
    sed: command not found
    Command 'ls' is available in '/bin/ls'
    The command could not be located because '/bin' is not included in the PATH environment variable.
    ls: command not found

    AND

    #env | grep -i path
    command 'grep' not available in '/bin/grep'
    command cannot be found, cause '/bin' not encluded in PATH
    grep: command not found
    Last edited by sedoyksa; April 5th, 2012 at 05:03 PM.

  4. #14
    Join Date
    Aug 2011
    Beans
    23

    Re: Setting "export PATH=/usr/bin:/bin" permnently

    solved

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •