Ovrigt/cowsay
Från Ubuntu Sverige
Innehåll |
[redigera] Om Cowsay
Cowsay är ett roligt litet program som körs i terminalen. Om man tex skriver:
cowsay Ubuntu rockar fett!
Så får man följande output:
< Ubuntu rockar fett! >
---------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
Om man läser manualen för cowsay, genom att skriva
man cowsay
så kan man få reda på en massa annat man kan skriva, för att få andra figurer eller miner på kossan. För att "gå ut" ur manualen trycker man på 'q'. Att leka med cowsay är ett bra sätt att vänja sig vid terminalen och att använda olika "flaggor".
[redigera] Installera Cowsay
sudo apt-get install cowsay
[redigera] cow-fortunes
Ett script som får en slumpad cowsay att antingen säga eller tänka fortunes.
Anropa scriptet i din ~/.bashrc eller /etc/bash.bashrc
#!/bin/bash # # SCRIPT: cow-fortunes # AUTHOR: Daniel Warhammar (Actually just a rewrite of Rakesh 'arky' Ambati's script 'cow-words.sh' found at http://playingwithsid.blogspot.com/2007/10/cowsay-configurable-talking-and.html) # DATE: 10 September 2008 # VERSION: you_must_be_kidding # # CREDITS: I Thank Karma_Police for the 'cow file randomizer code' # # PURPOSE: Pipes a fortune-mod fortune into a randomized cowsay # # DEPENDS: 'fortune-mod' # Whatever fortune package you desire (google fortune-mod for more) # 'cowsay' (http://www.nog.net/~tony/warez/cowsay.shtml) # Packages are available in Debian and Ubuntu repositories. # To install them just type 'apt-get install fortune-mod cowsay' # # # set -x # Uncomment this for debugging. # # ##################################### # Use 'cowsay -l' to the full list of cow files in your system. # ###################################### cows=(apt beavis.zen bong bunny cower daemon default flaming-sheep head-in hellokitty koala luke-koala mech-and-cow moofasa moose mutilated ren satanic sheep skeleton small sodomized sodomized-sheep stimpy supermilker surgery three-eyes tux udder vader vader-koala www) random=RANDOM%32 # ######################################## # Should he think or say # ######################################## sink=(cowsay cowthink) random2=RANDOM%2 ########################################## # Pipe fortunes through cowsay. 'fortune -a' make use of all available fortune packages # ######################################## fortune -a | ${sink[random2]} -f ${cows[random]} # End of the script
