| Summary: | "fortune -m" peeks in "fortune" file only | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Yar Tikhiy <yar> |
| Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 5.2-CURRENT | ||
| Hardware: | Any | ||
| OS: | Any | ||
State Changed
From-To: open->closed
I think it works as expected these days.
It promises the right files:
[~] edwin@k7>fortune -m test -f
___% /usr/share/games/fortune
___% fortunes
[~] edwin@k7>fortune -m test -f -a
___% /usr/share/games/fortune
___% fortunes
___% fortunes2-o
___% fortunes-o
It displays the right files:
[~] edwin@k7>fortune -m test | grep "%% ("
%% (fortunes)
[~] edwin@k7>fortune -m test -a | grep "%% ("
%% (fortunes)
%% (fortunes-o)
|
fortune(6) displays fortunes from the "fortunes" and "fortunes2" files by default. This can be verified with "fortune -f". However, searching for a pattern with -m applies to "fortunes" only. How-To-Repeat: $ /usr/games/fortune -m LESSER-KNOWN -f ___% /usr/share/games/fortune ___% fortunes ___% fortunes2 That is fortune(6) promises to look into the two files. Now let's actually search for the phrase. $ /usr/games/fortune -m LESSER-KNOWN | fgrep "%% (" %% (fortunes) The phrase is found in "fortunes" only. Now let's add the "all" argument to fortune(6). $ /usr/games/fortune -m LESSER-KNOWN all | fgrep "%% (" %% (fortunes) %% (fortunes2) I.e., the phrase is present "fortunes2", too, but fortune(6) won't find it there by default. Conclusion: "fortune -m" won't look into "fortunes2", although it promises to.