[Oliver Kiddle] >> The output of acroread -version cannot be piped to stdout for >> some reason, so the version number must be read from >> ACROREAD-PREFIX/Reader/AcroVersion. Since acroread might have >> been started via a wrapper script, the only failsafe way of >> determining ACROREAD-PREFIX is to look at the output of acroread >> -help. > > Unfortunately, this doesn't work on the system I tried it on, using > Adobe's rpm. /usr/bin/acroread is a symbolic like to > /usr/local/Adobe/Acrobat7.0/bin/acroread. Handling that involves using ls > to get the symlink destination. > > Is acroread always a script? The following works well (and very quickly) > on any system I have access to: > grep '^ver=' =acroread > > From a completion function, we can use $commands[$words[1]] instead > of =acroread. It doesn't work when acroread is a wrapper script, which it is in my case. (I used a wrapper instead of a symlink, because the script needs to do some things before it starts acroread, such as turning off core dumps (some versions of acroread 5.x used to crash a _lot_).) Even if I rename the script to something other than 'acroread', I still couldn't use =acroread since the real acroread executable isn't in my PATH. :-/ So I'll just have to resolve the symlink using readlink. I assume the most portable way to do this is perl, unless there is a way to make zsh expand the link itself. I have attached a version that does this. Should handle any level of symbolic links that point to new symbolic links. -- Haakon