Created
May 6, 2022 20:54
-
-
Save peevees/1d8af11ee4de7ea6db675194153967c3 to your computer and use it in GitHub Desktop.
just a little bash script playing around
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# special environment variables | |
# $RANDOM -> between 0 - 32747 | |
# $SHELL | |
# $USER | |
# $PWD | |
# $HOSTNAME | |
# .bashrc can be edited to add environment variables on next login | |
# math symbols | |
# + - * / % | |
# can be executed by ex: echo $(( 1 + 1 )) | |
# giving 2 as output | |
echo "Hello, what is your name?" | |
read name | |
echo "Hi $name and how old are you?" | |
read age | |
echo "well hello $name of age $age" | |
sleep 2 | |
echo "Calculating..." | |
echo -ne '##### (33%)\r' | |
sleep 1 | |
echo -ne '############# (66%)\r' | |
sleep 1 | |
echo -ne '####################### (100%)\r' | |
echo -ne '\n' | |
echo -ne '\n' | |
getRich=$((( $RANDOM % 15 ) +$age )) | |
echo "$name, you will become a millionare when you are $getRich years old." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment