![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| repeat character with printf | ripat | Shell Programming and Scripting | 13 | 06-18-2009 07:01 AM |
| Repeat last entered command ? | vilius | Shell Programming and Scripting | 5 | 09-25-2007 07:15 AM |
| to copy and repeat | falcondown01 | Shell Programming and Scripting | 4 | 09-07-2007 09:15 PM |
| Repeat Commands | dereckbc | UNIX for Dummies Questions & Answers | 6 | 01-04-2005 11:15 AM |
| any idea to repeat a action in VI | myelvis | UNIX for Dummies Questions & Answers | 6 | 11-26-2003 06:21 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Repeat a command in a shell
Hi there,
i would like to repeat a command in a shell sript (bash) the script starts with a menu to choose a menu point to do something .... on the end of the script i would like to restart the programm to choose the menu points on the beginning. I would also make a sript that send every 3-4 minutes a simple command (e.g. df -k ore date ....) to avert a disconnet. pls help. thanks! |
|
||||
|
for the menu to keep popping up after you choose a menu item and it executes you can do the following :-
Just after your comments in the beginning of your scripts ( I'm presuming that you are using a case statement to write your menu) eg. Code:
while true
do
clear
# The following is displayed as a menu on the user's screen
echo " Administrator's Menu
====================
1) View backup status
Enter your Choice ==> \c"
read CHOICE DUMMY
# This section executes the user's choice of commands from the above menu
case "$CHOICE" in
# This command shows the last ten lines of the backup log to allow
# the Administrator to view the status of the backups over the last
# few days
1 ) tail -10 /usr/scripts/backup.log |pg
;;
esac
done
added code tags --oombera Last edited by oombera; 02-17-2004 at 02:54 PM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|