Well, since I'm trying to run unpak.sh on a NSLU2 with Debian as well, I've run into the exact same problem. Seems sed chokes on the expression you quoted (and another) from the script.niours wrote:This function (from unpak.sh) generates an error :
RE_ESCAPE_FOR_SED() {
sed 's/\([][.*/\]\)/\\\1/g'
}
I don't understand what it does so i can't find out what's wrong with it.
Any idea ?
Could it be something wrong with my version of sed like it was for awk (mawk vs gawk) ?
Damien
Code: Select all
...
#Add '\' to regular expression metacharacters in a string.
#Required so we can search for the string whilst using regualr expressions.
# eg grep "^$string$". this will fail if string contains '[].* etc.
RE_ESCAPE_FOR_SED() {
sed 's/\([].[*/\]\)/\\\1/g'
}
# Same as RE_ESCAPE_FOR_SED but (|) are also meta characters.
RE_ESCAPE_FOR_GREP() {
sed 's/\([].[*/\(|)]\)/\\\1/g'
}
...
Users browsing this forum: No registered users and 47 guests