Auffie’s Random Thoughts

Friday, June 08, 2007

Fixing "expr: syntax error" in Acrobat Reader for Linux

I wonder how Adobe managed to get it to release: after installing Acrobat Reader 7.0 for Linux from the rpm, as soon as I invoked acroread the script went into an infinite loop spitting out the message

expr: syntax error

After digging around the net, I found the solution. It’s apparently a small typo in a regular expression that failed to match the version string on a dynamically linked library. Here is the fix (in diff notation; I’ve modified the indentation to make it display better on the blog):

418c418
< echo $mfile| sed 's/libgtk-x11-\([0-9]*\).0.so.0.\([0-9]\)00.\([0-9]*\)\|\(.*\)/\1\2\3/g'
---
> echo $mfile| sed 's/libgtk-x11-\([0-9]*\).0.so.0.\([0-9]*\)00.\([0-9]*\)\|\(.*\)/\1\2\3/g'

The fix is to add the Kleene * to the second [0-9] in the regular expression. With the fix the script now works smoothly.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]



<< Home