This is a Bash script that generates a random quote and a randomly selected ASCII art image or a cow image, depending on the user's input. It can display either one or two sets of image and quote, depending on the input arguments.
The script takes two optional command-line arguments:
$ bash rncaaqc.sh [neofetch|cowsay] [neofetch|cowsay]
The first argument specifies the program to use (neofetch or cowsay). If neofetch is selected, the script will display a randomly selected ASCII art image using the neofetch program. If cowsay is selected, it will display a randomly selected cow image and a quote using the cowsay program.
The second argument is optional and specifies whether to display a second set of image and quote using the same program. If a second argument is provided, the same program must be used as the first argument.
If no arguments are provided, the script will prompt the user to input the desired program (neofetch or cowsay).
The location of the quotations file (quotation.txt) needs to be modified in the script. By default, the script uses the path /Folder/quotation.txt to access the quotations file. Therefore, it is important to modify this value to correspond to the actual location of the file on your system.
To do this, you can edit the script and modify the variable puff to contain the absolute path of the quotation.txt file on your system. For example, if your quotation.txt file is located in your home folder, you can modify the puff variable as follows:
puff=~/quotation.txt
Make sure that the path you specify is correct and that the quotations file is present at that location on your system.
To use this script, follow these steps:
-
Clone the Repository: Clone this repository to your local machine.
git clone https://github.com/Superjulien/Rncaaqc.git
-
Navigate to the Script Directory: Move into the directory containing the script.
cd path/to/your-repo/Rncaaqc/
-
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 rncaaqc.sh
-
Run the Script: Execute the script using the following command:
bash rncaaqc.sh cowsay neofetch
To modify the script to use your own quotation.txt
file, follow these steps:
-
Open the Script File: Open the
rncaaqc.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
rncaaqc.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 ASCII art images are stored in an array called neo, and the cow images are stored in an array called cow. Each image is named after the animal or object it depicts and has a .ascii file extension. The images were sourced from various websites and online repositories of ASCII art.
The quotes are stored in a file called quotation.txt. The file contains a list of quotes from various sources, separated by newline characters.
The script uses the shuf command to select a random quote from quotation.txt. It then uses the /dev/urandom command to generate random numbers between 0 and 9, which are used to select a random image from the neo or cow array. The selected image is then passed to the selected program (neofetch or cowsay) along with the quote.
Here are some example commands to run the script:
$ bash rncaaqc.sh cowsay
$ bash rncaaqc.sh neofetch
$ bash rncaaqc.sh cowsay neofetch
This script should work on most Unix-like operating systems, including Linux and macOS. It requires the cowsay and neofetch programs to be installed.
sudo apt update && sudo apt upgrade -y
sudo apt install cowsay neofetch
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 :