Simple shell script
Posted: September 29, 2009 at 10:38 pm | Tags: Linux , shell scriptThis is a simple shell script. This is what it can do:
[1] Display current time and date
[2] Display files from current folder
[3] Display the calendar
[4] Start year text editor
[5] Harddisk information
[6] Verify with ping resourcesit.com
This is the complete script. Feel free to use or modify as you like to:
while:
do
clear
echo "-------------"
echo "Test Menu - www.etuts.resourcesit.com"
echo "-------------"
echo "[1] Display current time and date"
echo "[2] Display files from current folder"
echo "[3] Display the calendar"
echo "[4] Start year text editor"
echo "[5] Harddisk information"
echo "[6] Verify with ping resourcesit.com"
echo "[7] Exit / Stop"
echo "======================="
echo-n "Select option [1-7]:"
read yourch
case $ yourch in
1) echo "Today's date is` date `, Hit enter to resume. . . ", Read;;
2) echo "` pwd `files is:" ls-l echo "Hit enter to resume. . . ", Read;;
3) horse; echo "Hit enter to resume. . . ", Read;;
4) gedit;;
5) df; echo "Hit enter to resume. . . ", Read;;
6) ping resourcesit.com; echo "Hit enter to resume. . . ", Read;;
7) exit 0;;*) Echo "Hellooo??! I said to pick option year from thoes displayed: 1,2,3,4,5,6 or 7 ";
echo "Hit enter to resume. . . ", Read;;
esac
done
Do not forget to Give the shell permission to execute your script:
chmod 755 the_script.sh


























The Discussion
see what everyone is Saying
[...] Simple shell script http://www.etuts.resourcesit.com/2009/09/29/simple-shell-script/ [...]
Zubao0 That's really thinking out of the box. Thanks!