Convert a non-POSIX extended sed regex to a basic notation

This commit is contained in:
Frank LENORMAND 2016-03-16 14:08:52 +02:00
parent bdb67d8227
commit 664f382ab2

View File

@ -40,10 +40,10 @@ def -params .. \
prefix=$(printf %s "$1" | cut -c1-${kak_pos_in_token} 2>/dev/null) prefix=$(printf %s "$1" | cut -c1-${kak_pos_in_token} 2>/dev/null)
for page in /usr/share/man/*/${prefix}*.[1-8]*; do for page in /usr/share/man/*/${prefix}*.[1-8]*; do
candidate=$(basename ${page%%.[1-8]*}) candidate=$(basename ${page%%.[1-8]*})
pagenum=$(printf %s "$page" | sed -r 's,^.+/.+\.([1-8][^.]*)\..+$,\1,') pagenum=$(printf %s "$page" | sed 's,^.*\.\([1-8].*\)\..*$,\1,')
case $candidate in case $candidate in
*\*) ;; *\*) ;;
*) printf %s $candidate\($pagenum\);; *) printf %s\\n $candidate\($pagenum\);;
esac esac
done done
} \ } \