Tuesday, April 20, 2010

newlines/escaping in regexes in vi

Regexes in vi make me sad sometimes. I discovered today that when I wanted to replace all instances of:
||
with:
|
|
the correct command wasn't
:%s/\|\|/\|\n\|/g
but rather:
:%s/||/|<ctrl-v><ctrl-m>|/g
... where <ctrl-v> literally means "hit ctrl-v".

Monday, April 19, 2010

kakadu can't access shared library

We were consistently getting errors from Kakadu (within Djatoka) that it couldn't access a shared library file: libkdu_v60R.so. The permissions on everything were 2770. It turned out that the problem was the 2 being set on the kdu_expand and the kdu_compress. When we changed the permissions back to 770, on those two files only, everything was fine.

I've encountered problems with 2xxx permissions before, as a security feature/bug on Solaris, but never on linux.