Skip to content

Instantly share code, notes, and snippets.

@anilsathyan7
Created July 31, 2017 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anilsathyan7/c3589832480b7b5c9ee779e2320858d8 to your computer and use it in GitHub Desktop.
Save anilsathyan7/c3589832480b7b5c9ee779e2320858d8 to your computer and use it in GitHub Desktop.
A sample shell-script code
clear
echo -e "\e[1;4mI LOVE SHELL SCRIPTING!!\n"
echo -e "WELCOME \033[31m$USER to $HOSTNAME"
$ echo -e "\033[7m Linux OS! Best OS!! \033[0m"
echo "Today is `date`"
val=`expr 6 + 3`
echo "six plus three is $val"
echo "What is your full name?"
read fname
echo "Hello $fname, my buddy!"
if [ "$fname" = "$USER" ]
then
for (( i = 0 ; i <= 5; i++ ))
do
echo "You are honest!!!"
done
else
echo "Not Cool Buddy..Be honest!!"
fi
echo -e "Bleed Blue... \e[96mOcean"
echo "You are $1 years old!!!"
fiveyearage=`expr $1 + 5`
echo $fiveyearage > fivefile.txt
echo "See fivefile.txt to see how old you will be after 5 years!!"
echo -e "Light's Out... \e[40mBlack"
echo -e "\033[1m SEE \033[2m YA \033[0m ..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment