Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33

Thread: syntax error in /etc/profile

  1. #1
    Join Date
    Sep 2017
    Location
    Melbourne, Australia
    Posts
    36

    Default syntax error in /etc/profile

    Hi friends,

    This is my first post to this forum so I will try to follow the accepted procedure.
    I recently upgraded my lenovo t420 laptop to Tumbleweed and while everything seems ok I keep getting the following multiple errors whenever I do a zypper dup.

    /etc/profile: line 185: syntax error near unexpected token `/usr/X11R6/bin'
    /etc/profile: line 185: `/usr/X11R6/bin'

    I have searched the net high and low for an answer to this error but as I am pretty much a noob about bash scripts and /etc/profile I'm not sure what the error is. It dosen't seem to negatively affect my system yet though I have noticed a few other errors like when I open a su terminal I get this at the prompt

    #
    -bash: /etc/profile: line 185: syntax error near unexpected token `/usr/X11R6/bin'
    -bash: /etc/profile: line 185: `/usr/X11R6/bin'

    Any help or advice would be greatly appreciated

    regards Tim

  2. #2
    Join Date
    Sep 2017
    Location
    Melbourne, Australia
    Posts
    36

    Default Re: syntax error in /etc/profile

    I thought that I better supply the relevant section of /etc/profile...
    Code:
    # Make path more comfortable
    #
    # save current path setting, we might want to restore it
    ORIG_PATH=$PATH
    #
    if test -z "$PROFILEREAD" ; then
    PATH=/usr/local/bin:/usr/bin:/bin
    if test "$HOME" != "/" ; then
    for dir in $HOME/bin/$CPU $HOME/bin ; do
    test -d $dir && PATH=$dir:$PATH
    done
    fi
    if test "$UID" = 0 ; then
    test -d /opt/kde3/sbin && PATH=/opt/kde3/sbin:$PATH
    PATH=/sbin:/usr/sbin:/usr/local/sbin:$PATH
    fi
    for dir in /usr/X11/bin
    /usr/X11R6/bin
    /var/lib/dosemu
    /usr/games
    /opt/bin
    /opt/kde3/bin
    /opt/kde2/bin
    /opt/kde/bin
    /usr/openwin/bin
    /opt/cross/bin
    do
    test -d $dir && PATH=$PATH:$dir
    done
    unset dir
    export PATH
    fi
    I hope that this helps
    Tim

  3. #3
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    1,230

    Default Re: syntax error in /etc/profile

    You seem to have lost the trailing "\"s to continue the path.
    From my Tumbleweed 20180122 /etc/profile:
    Code:
        for dir in  /usr/X11/bin \
                    /usr/X11R6/bin \
                    /var/lib/dosemu \
                    /usr/games \
                    /opt/bin \
                    /opt/kde3/bin \
                    /opt/kde2/bin \
                    /opt/kde/bin \
                    /usr/openwin/bin \
                    /opt/cross/bin
        do
            test -d $dir && PATH=$PATH:$dir
        done
    Your line 185 is my line 173

    I suspect that your problem might lie with:
    I recently upgraded
    Did you perform a distribution upgrade, as needed for Tumbleweed?
    Something like:
    Code:
     # zypper dup --from http://download.opensuse.org/tumbleweed/repo/non-oss/
    --
    slàinte mhath,
    rayH

    ~ knowing the right answer is easier than knowing the right question.

  4. #4
    Join Date
    Sep 2017
    Location
    Melbourne, Australia
    Posts
    36

    Default Re: syntax error in /etc/profile

    Hi
    Actually no i did a network dist upgrade but I originally tried from a usb.
    Tim Freedman
    Lenovo t420 tumbleweed x86_64 GNU/Linux

  5. #5
    Join Date
    Sep 2017
    Location
    Melbourne, Australia
    Posts
    36

    Default Re: syntax error in /etc/profile

    How can I obtain an un-corrupted version of /etc/profile?
    Tim Freedman
    Lenovo t420 tumbleweed x86_64 GNU/Linux

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,746

    Default Re: syntax error in /etc/profile

    Quote Originally Posted by tim3dman View Post
    How can I obtain an un-corrupted version of /etc/profile?
    Using YaST > Software > Software Management and then searching for prifile with the item File list checked only, I find that /etc/profile is part of product aaa_base.

    So you do a forced install of aaa_base. But it contains 73 files in total. I assume that you did not made any changes there (but OTOH your /etc/profile apparently is changed), but you have a quick look at that list before you overwrite all of them (I guess that they are all files that should not have been changed at all because the change that they are overwritten at a re-install/update is there).
    Henk van Velden

  7. #7
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    1,230

    Default Re: syntax error in /etc/profile

    Quote Originally Posted by tim3dman View Post
    How can I obtain an un-corrupted version of /etc/profile?
    It is a symptom of a bad upgrade (you did not say what you upgraded from).
    Code:
     # zypper dup --from http://download.opensuse.org/tumbleweed/repo/non-oss/
    should fix things. If it does not, please post the version from /etc/os-release and the output from
    Code:
     > zypper lr -d -E
    as well as any error messages.
    --
    slàinte mhath,
    rayH

    ~ knowing the right answer is easier than knowing the right question.

  8. #8

    Default Re: syntax error in /etc/profile

    /etc/profile is marked as config file though, so rpm will not replace it if it has been modified when updating the package (not even when using "zypper dup"... ).
    So check whether you have an /etc/profile.rpmnew file and rename that to /etc/profile.

    Or delete your /etc/profile and force a reinstallation of aaa_base to get the original file.
    Code:
    zypper in -f aaa_base
    Last edited by wolfi323; 25-Jan-2018 at 06:46.

  9. #9
    Join Date
    Sep 2017
    Location
    Melbourne, Australia
    Posts
    36

    Default Re: syntax error in /etc/profile

    Thanks for your help guys, I appreciate it.
    Tim Freedman
    Lenovo t420 tumbleweed x86_64 GNU/Linux

  10. #10
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,746

    Default Re: syntax error in /etc/profile

    Quote Originally Posted by tim3dman View Post
    Thanks for your help guys, I appreciate it.
    Thanks for your appreciation.

    But we all want to know if it "worked".
    Henk van Velden

Page 1 of 4 123 ... LastLast

Posting Permissions

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