This script generates a random quotation and displays it using the cowsay
command. The selected quotation is sourced from a file named quotation.txt
located in the specified directory. The script also selects a random ASCII art cow (or other creature) to display the quotation alongside.
Please note that an updated version of these scripts is available at the following address: https://github.com/Superjulien/Rncaaqc
Feel free to check out the new version for any enhancements or changes that may have been made.
- Generates random quotations from a customizable
quotation.txt
file. - Displays quotes in a charming and eye-catching ASCII art format.
- Offers a variety of ASCII art animals to choose from, adding a playful touch to your terminal.
- Easily customizable for personalized quotes and creatures.
Before using this script, make sure you have the following:
-
cowsay: Ensure that the
cowsay
command-line tool is installed on your system. If it's not installed, you can typically install it using package managers likeapt
,yum
, orbrew
. For example:# On Debian-based systems (Ubuntu): sudo apt-get install cowsay # On Red Hat-based systems (Fedora): sudo yum install cowsay # On macOS (using Homebrew): brew install cowsay
To use this script, follow these steps:
-
Clone the Repository: Clone this repository to your local machine.
git clone https://github.com/Superjulien/Cowsay-Quotation.git
-
Navigate to the Script Directory: Move into the directory containing the script.
cd path/to/your-repo/Cowsay-Quotation/
-
Modify the
quotation.txt
File: Replace the contents ofquotation.txt
with your desired collection of quotations. Each quotation should be on a new line. -
Make the Script Executable: Ensure the script has executable permissions.
chmod +x quotation_cowsay.sh
-
Run the Script: Execute the script using the following command:
./quotation_cowsay.sh
To modify the script to use your own quotation.txt
file, follow these steps:
-
Open the Script File: Open the
quotation_cowsay.sh
file in a text editor of your choice, such asnano
,vim
, or even a graphical text editor likeVisual Studio Code
. -
Find the File Path Definition Line: Locate the line where the path to the
quotation.txt
file is defined. This line looks like this:puff=~/Folder/quotation.txt
Replace
~/Folder/quotation.txt
with the absolute path to your ownquotation.txt
file. For example, if yourquotation.txt
file is located in the directory/path/to/my/folder
, you should have:puff=/path/to/my/folder/quotation.txt
-
Save the File: After making the modifications, save the
quotation_cowsay.sh
file. -
Run the Script: Now, when you run the script, it will use the
quotation.txt
file you specified.
Make sure that the quotation.txt
file contains a list of quotes, with each quote on a new line. Here's an example of content for your quotation.txt
file:
Life is beautiful.
Learning is an endless journey.
Happiness is found in the little things.
Nothing is impossible, will makes everything.
Once you've followed these steps and modified the script according to your needs, you can run the script to generate random quotes from your own quotation.txt
file.
The script (quotation_cowsay.sh
) performs the following steps:
-
It defines the path to the
quotation.txt
file using thepuff
variable. -
It generates a random number between 0 and 9 using
/dev/urandom
and stores it in therandom
variable. -
It selects a random line from
quotation.txt
usingshuf
and saves it to a temporary file named.quotation.txt
in the/tmp
directory. -
It reads the content of
.quotation.txt
into thevar
variable. -
Based on the value of
random
, it assigns a creature name (like "tux," "moose," "moofasa," etc.) to thetmp
variable. -
It uses the
cowsay
command with the selected creature and quotation to generate the ASCII art output.
- You can customize the creature names and their corresponding values in the script to add your own creative ASCII art animals.
- Remember to keep your
quotation.txt
file updated with meaningful and interesting quotes. - The script assumes that the
cowsay
command is available in your system's PATH. - This script is provided as-is and may require adjustments based on your system's configuration.
This software is provided to you free of charge, with the hope that if you find it valuable, you'll consider making a donation to a charitable organization of your choice :
-
SPA (Society for the Protection of Animals): The SPA is one of the oldest and most recognized organizations in France for the protection of domestic animals. It provides shelters, veterinary care, and works towards responsible adoption.
-
French Popular Aid: This organization aims to fight against poverty and exclusion by providing food aid, clothing, and organizing recreational activities for disadvantaged individuals.
-
Doctors Without Borders (MSF): MSF provides emergency medical assistance to populations in danger around the world, particularly in conflict zones and humanitarian crises.
-
Restaurants of the Heart : Restaurants of the Heart provides meals, emergency accommodation, and social services to the underprivileged.
-
French Red Cross: The Red Cross offers humanitarian aid, emergency relief, first aid training, as well as social and medical activities for vulnerable individuals.
Every small gesture matters and contributes to making a real difference.
For support email :