when I set LC_ALL or LANG or what not fortune stops working with commands like "fortune all" I used to use something like "fortune 80% off all" but this stopped working once i set LANG. $ fortune all (fortune output) $ LANG="en_US.UTF-8" fortune all No fortunes found
When $LC_ALL or $LANG are set fortune looks for files in a subdirectory of the cookie directory named after the locale. To get around this you can create a directory /usr/share/fortune/$LC_ALL then from there create a symlink: ln -s .. all
I just tried that however, it still doesn't work. I ran "strace fortune all" and accordingly I see it does go into the directory and follow the symlink I created however it still reports "no fortunes found" here's some example output: stat64("/usr/share/fortune/en_US.UTF-8/all/knghtbrd", {st_mode=S_IFREG|0644, st_size=90917, ...}) = 0 stat64("/usr/share/fortune/en_US.UTF-8/all/knghtbrd", {st_mode=S_IFREG|0644, st_size=90917, ...}) = 0 open("/usr/share/fortune/en_US.UTF-8/all/knghtbrd", O_RDONLY) = 43 stat64("/usr/share/fortune/en_US.UTF-8/all/knghtbrd.u8", {st_mode=S_IFREG|0644, st_size=90917, ...}) = 0 access("/usr/share/fortune/en_US.UTF-8/all/knghtbrd.dat", R_OK) = 0 stat64("/usr/share/fortune/en_US.UTF-8/all/knghtbrd.dat", {st_mode=S_IFREG|0644, st_size=2244, ...}) = 0 stat64("/usr/share/fortune/en_US.UTF-8/all/knghtbrd.dat", {st_mode=S_IFREG|0644, st_size=2244, ...}) = 0 open("/usr/share/fortune/en_US.UTF-8/all/knghtbrd.dat", O_RDONLY) = 44 stat64("/usr/share/fortune/en_US.UTF-8/all/knghtbrd.dat.u8", 0xbfb5fbf4) = -1 ENOENT (No such file or directory) close(44) = 0 stat64("/usr/share/fortune/en_US.UTF-8/all/knghtbrd.u8", {st_mode=S_IFREG|0644, st_size=90917, ...}) = 0 stat64("/usr/share/fortune/en_US.UTF-8/all/knghtbrd.u8", {st_mode=S_IFREG|0644, st_size=90917, ...}) = 0 open("/usr/share/fortune/en_US.UTF-8/all/knghtbrd.u8", O_RDONLY) = 44 stat64("/usr/share/fortune/en_US.UTF-8/all/knghtbrd.u8.u8", 0xbfb5fbf4) = -1 ENOENT (No such file or directory) access("/usr/share/fortune/en_US.UTF-8/all/knghtbrd.u8.dat", R_OK) = -1 ENOENT (No such file or directory) close(44) = 0 and here's the end of the output: stat64("/usr/local/share/fortune", 0xbfb60084) = -1 ENOENT (No such file or directory) stat64("/home/xero/all", 0xbfb60084) = -1 ENOENT (No such file or directory) write(2, "No fortunes found\n", 18No fortunes found ) = 18 exit_group(1) = ?
works for me ... on my machine fortune looks in a LANG subdir first and then falls back to the main shared dir if it wasnt able to find anything what does this show on your machine: strings `which fortune` | grep /usr
(In reply to comment #2) > I just tried that however, it still doesn't work. > Sorry, I've just noticed that it was only working because my cwd was /usr/share/fortune/$LANG.
(In reply to comment #3) > what does this show on your machine: > strings `which fortune` | grep /usr $ strings `which fortune`|grep /usr /usr/local/share/fortune/off /usr/share/fortune/off /usr/local/share/fortune /usr/share/fortune
Fixed in CVS. Thanks for report