[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Paramétrage de fortunes-fr (0.3-3) ...



Le Wednesday 21 August 2002 23:03, Benoît Barbier a écrit :


> J'ai écrit un mini script pour choisir aléatoirement les fortunes en
> français, mais je ne le trouve pas élégant du tout. N'y a-t-il pas une
> possibilité de config toute faite?

Bonjour

Tu peux specifier plusieurs fichiers de cookies en argument pour fortune

stef@moon:~$ fortune chalkboard hitchhiker riddles starwars

Là il va taper aléatoirement dans les 4 fichiers passés en arguments.
Tu peux également spécifier un pourcentage si tu préferes avoir bcp de 
starwars et peu du reste: extrait du man

       "The user may specify alternate sayings.  You can specify a
       specific  file,  a  directory  which  contains one or more
       files, or the special word all which says to use  all  the
       standard  databases.   Any  of  these may be preceded by a
       percentage, which is a number n between 0 and  100  inclu­
       sive,  followed  by a %.  If it is, there will be a n per­
       cent probability that an adage will be  picked  from  that
       file  or  directory. If the percentages do not sum to 100,
       and there  are  specifications  without  percentages,  the
       remaining  percent will apply to those files and/or direc­
       tories, in which case the probability  of  selecting  from
       one of them will be based on their relative sizes."

Hope this helps






Reply to: