Page 1 of 1

Minor linux bash tweek 0.33

Posted: Fri Dec 24, 2010 5:11 pm
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.

Re: Minor linux bash tweek 0.33

Posted: Sat Dec 25, 2010 11:22 am
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.

Re: Minor linux bash tweek 0.33

Posted: Wed Dec 29, 2010 10:52 am
by cch44
Merci pour l'info.
Super.