Add

Simple shell script


This is a simple shell script. This is what it can do:

[1] Display curent time and date
[2] Display files from current folder
[3] Display the calendar
[4] Start an text editor
[5] Harddisk information
[6] Verify resourcesit.com with ping

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 curent time and date”
echo “[2] Display files from current folder”
echo “[3] Display the calendar”
echo “[4] Start an text editor”
echo “[5] Harddisk information”
echo “[6] Verify resourcesit.com with ping”
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 are:” ; ls -l ; echo “Hit enter to resume. . .” ; read ;;
3) cal ; 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 an option from thoes displayed: 1,2,3,4,5,6 or 7″;
echo “Hit enter to resume. . .” ; read ;;
esac
done

Don’t forget to give the shell permission to execute your script:

chmod 755 the_script.sh

shell-script

1 Star2 Stars3 Stars4 Stars5 Stars (14 votes, average: 5.00 out of 5)
Loading ... Loading ...

The Discussion

see what everyone is saying

Respond

get in on the action.

* Required

Rumanian flagItalian flagEnglish flagGerman flagFrench flagSpanish flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroat flagDanish flagFinnish flagSwedish flagNorwegian flagSerbian flagSlovenian flagUkrainian flagTurkish flagHungarian flag
By N2H

Random Posts Recent Comments

  • admin Says:

    Amigo, Please formulate your question in english if you really need help! Cheers!...

  • Mauricio Gonçalves Says:

    Boa tarde, Amigo eu não consigo add novo user poderia me ajudar? ele fala que o comando não é ...

  • Flossy Says:

    Zubao0 That's really thinking out of the box. Thanks!...

  • Michael Esch Says:

    I used this tutorial to install Komodo Edit 6 on Ubuntu 10.10; I rate your tutorial 5/5 I hope that...

  • admin Says:

    @dan Am rulat aplicatii create in visual basic si in fox sub wine, deci cred ca nu ar trebui sa fie ...

  • dan Says:

    as dori sa imi spuneti daca un prg de conta sub visual basic ruleaza cu wine sub ubuntu intreb deo...

  • admin Says:

    Thank you all for your comments. As I was busy latelly, I haven't answer to your posts. I hope you u...

  • tcpdump Says:

    Hello, I also faced the error "It appears as though you do not have permission to view informatio...

  • Ali Says:

    awesome!!!...

  • Schedule Says:

    You you should make changes to the post subject Split and join files in Ubuntu with lxsplit | EtutsR...

Tag Cloud