Register
It is currently Sat Dec 20, 2014 4:40 am

Help Needed


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Mon Jan 05, 2009 6:28 am   

Joined: Mon Jan 05, 2009 6:22 am
Posts: 1
Hi im a noob to scripting but would like to see what a menu driven loop is and how would i incorporate the four options i have into it

the options are
1. Backup all files from a specified location to a date stamped folder
2. carry out an incremental backup only files updated since the last backup
3. restore files from a specified backup location
4. quit the program

I have been told this is relatively easy but until now can only get a backup to work i cannot write a loop or menu that looks the same as above is it possible and if so any help would be much appreciated.


Top
 Profile  
 PostPosted: Mon Jan 05, 2009 7:08 am   

Joined: Mon Dec 15, 2008 1:55 am
Posts: 1
Code:
#! /bin/bash

echo "Your options are:"
echo "1. Backup all files"
echo "2. Backup incremental"
echo "3. Restore file(s)"
echo "4. Leave the show"
echo -n "Your choice [1-4]: "
read CHOICE

case $CHOICE in
1)
  echo "1st option chosen" # do something
;;
2)
  echo "2nd option chosen" # do something
;;
3)
  echo "3rd option chosen" # do something
;;
4)
  echo "4th option chosen" ; exit 0
;;
*)
  echo "Invalid choice :-(" ; exit 1
;;
esac

# game over


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP