Minor linux bash tweek 0.33

Ideas for improvements and requests for new features in XnView MP

Moderators: XnTriq, helmut, xnview

wseverin
Posts: 2
Joined: Mon Dec 06, 2010 4:19 am

Minor linux bash tweek 0.33

Post by wseverin »

Comment applies to Ubuntu Linux 10.10. Other OS, other version YMMV.

The 'improved' bash script to launch xnview doesn't seem to work if it's run from anywhere but the working directory. Problem is the first line of code which just returns dirname "." and it really needs to be the absolute path. The fix is simple. Change

Code: Select all

dirname="$(dirname "$(readlink "$0")")"
to

Code: Select all

dirname="$(dirname "$(readlink -f "$0")")"
Note the "-f" to force a canonicalized name.
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: Minor linux bash tweek 0.33

Post by oops66 »

wseverin wrote:Comment applies to Ubuntu Linux 10.10. Other OS, other version YMMV.
The 'improved' bash script to launch xnview doesn't seem to work if it's run from anywhere but the working directory. Problem is the first line of code which just returns dirname "." and it really needs to be the absolute path. The fix is simple. Change

Code: Select all

dirname="$(dirname "$(readlink "$0")")"
to

Code: Select all

dirname="$(dirname "$(readlink -f "$0")")"
Note the "-f" to force a canonicalized name.
Right, it's better like that, thank for the hint.
XnViewMP Linux X64 - Debian - X64
User avatar
cch44
Posts: 37
Joined: Wed Aug 31, 2005 7:04 am
Location: Nantes

Re: Minor linux bash tweek 0.33

Post by cch44 »

Merci pour l'info.
Super.