bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in shell script mode


From: A Soare
Subject: Bug in shell script mode
Date: Thu, 12 Apr 2007 11:37:14 +0200 (CEST)

readlink()
{
    OLDPWD="`/bin/pwd`"
    lfile="$1"

    while [ -h "$lfile" -a -f "$lfile" ]; do
        CWD="`dirname "$lfile"`"
        if [ "`expr "${CWD}" : "\.\."`" = "2" ]; then
            CWD="`/bin/pwd`/$CWD"
        fi
        lfile="`basename "$lfile"`"
        cd "$CWD"
        lfile="`/bin/ls -l "$lfile"|sed 's/^.*-> *\(.*\) *$/\1/'`"
    done

    if [ -f "$lfile" ]; then
        CWD="`dirname "$lfile"`"
        lfile="`basename "$lfile"`"
        if [ "`expr "${CWD}" : "\.\."`" = "2" ]; then
            CWD="`/bin/pwd`/$CWD"
        fi
        cd "$CWD"
        echo `/bin/pwd`/$lfile
        cd "$OLDPWD"
        return 0
    fi

    cd "$OLDPWD"
    return 1
}

Copy and paste this text into a buffer with shell-script [sh] mode.

After this line

        if [ "`expr "${CWD}" : "\.\."`" = "2" ]; then

all text seems a string, even it is correct. More, if we try to select it with 
double click on the left [, we obtain the message 

forward-sexp: Scan error: "Unbalanced parentheses", 10177, 22308.








reply via email to

[Prev in Thread] Current Thread [Next in Thread]