blfs book -suggested /etc/profile

Linux linux at herbasource.com
Tue Jul 15 05:33:08 PDT 2003


Hi

I have used the suggested /etc/profile in the ver4.1 blfs book however it does not appear to like something and the $PATH is not set accordingly.
When logging in it shows [: missing ']' after the other login stuff, which would indicate to me that bash thinks there is a missing ] in the code somewhere.

I have checked and re checked and am 99.9999% sure that the code is identical to that in the book. I am very new to Linux so do not have the knowledge at this stage to see if the syntax of the code is correct but would imagine that it is correct otherwise it would not be in the 'book'

The bits of code that appear to generate the error in my etc/profile

# Function to help us manage paths
pathman()
{
    if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:) ; then
        if [ "$2" = "last" ] ; then
            PATH=$PATH:$1
        else
            PATH=$1:$PATH
        fi
    fi
}
# Add to the standard path
if [ $(id -u) = 0 ] ; then
    if [ -d "/usr/local/sbin" ] ; then
        pathman /usr/local/sbin last
    fi
if [ $(id -u) != 0 ] ; then
    if [ -d "/usr/local/bin" ] ; then
        pathman /usr/local/bin last
    fi
fi
if [ -d "/usr/X11R6/bin" ] ; then
    pathman /usr/X11R6/bin last
fi

# Setup the INPUTRC enviroment variable
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc ; then
    INPUTRC=/etc/inputrc
fi

I am sure that this is how it appears in the book, what is wrong?

Thanks Jeff Surgeson


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfromscratch.org/pipermail/blfs-support/attachments/20030715/e9fa5238/attachment.html>


More information about the blfs-support mailing list