473,395 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

quit command

77
i have the following script.. but i cant get the quit command working...

can some1 help

quit = n

host="$(hostname)"
todaysdate="$(date)"
lastboot="$(last reboot)"
licensinginfo="$(uname -a)"

currenthardwareinfo="$(info)"
diskspace="$(df)"

IPAddress="$(/sbin/ifconfig)"

while [ "$quit" = "n" ]
do
clear

echo "1. General machine information"
echo "2. Machine hardware/software information"
echo "3. Network related information"
echo "4. User related information"
echo "Q. Quit"

echo "Please make your selection"

read menunumber
if [ $menunumber -eq 1 ]
then
echo " The hostname is $host"
echo " The date is $todaysdate"
echo " The system last rebooted is $lastboot"
echo " Licensing info:$licensinginfo"

echo " Press Enter Key to continue"
read ;


else if [ $menunumber -eq 2 ]
then
echo " Current Hardware: $currenthardwareinfo"
echo " Disk space: $diskspace"

echo " Press Enter Key to continue"
read ;


else if [ $menunumber -eq 3 ]
then
echo "IP Address: $IPAddress"

echo " Press Enter Key to continue"
read ;

else if Q|q) quit=y;
*) echo "Invalid Choice"



fi

fi

fi

sleep 1
done
Mar 28 '07 #1
5 3195
Motoma
3,237 Expert 2GB
Rather than having a variable, and checking that again and again, just check for the quit command, and exit.
Mar 29 '07 #2
Mubs
77
Rather than having a variable, and checking that again and again, just check for the quit command, and exit.
and how can i do that...
Mar 29 '07 #3
Motoma
3,237 Expert 2GB
inside the while loop:
Expand|Select|Wrap|Line Numbers
  1. else if Q|q) exit;
  2.  
Mar 29 '07 #4
Mubs
77
inside the while loop:
Expand|Select|Wrap|Line Numbers
  1. else if Q|q) exit;
  2.  
i have tried that it stil doesnt work
Apr 5 '07 #5
Motoma
3,237 Expert 2GB
i have tried that it stil doesnt work
What happens?
Are you sure that section of code is actually being called? Put some echo statements in choice sections of code to make sure the flow is going the way you think it should be going.
Apr 5 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Jane Austine | last post by:
>Jane Austine wrote: >>>>from Tkinter import * >>>>>r=Tk() >>>>>b=Button(r,text='Quit',command=r.quit) >>>>>b.pack() >>>>>r.mainloop() >> >> >> And when I press the "Quit" button the mainloop...
4
by: KB | last post by:
Hi, I want to write a Python script that controls and automates a Windows GUI computation program. My problem is that I do not know how to quit the Windows GUI program gracefully with a...
1
by: G.Gerard | last post by:
Hello Is there a way in Access code to detect that the Quit command ( Application.Quit ) has been activated ? or if not can a custom procedure be activated when the Exit (Top right corner X...
2
by: Lauren Quantrell | last post by:
Running Access2000 ADP Project/MSDE on Windows XP... - I Open my Access ADP project. In the Windows Task Manager Processes window MSACCESS.EXE shows up. - I don't do anything else in Access. - I...
6
by: Max | last post by:
I have the following code on a form that launches Microsoft Outlook and creates a new email message for the user: Outlook.Application oApp = new Outlook.Application(); Outlook.MailItem oMail...
1
by: Steven Thomas | last post by:
I have a windows service that uses office xp automation. Here is the code --------------------------------------- Public Sub CAccessSnapShot() Try Dim objAccess As New Access.Application() Dim...
5
by: mzdude | last post by:
I've just started playing with Python. Installed 2.5 on Windows XP system. I'm working through some of the examples in Programming Python 3ed by Mark Lutz. Given the following example when the Quit...
4
by: Bob | last post by:
Hi, If the test is true, the message 'not available' must be shown and quit the program. But when the test is true and when table 'data2' is empty (so nrg=0), i get the error:"dividing by...
0
by: raddrummer | last post by:
Hi there, I have 2 issues happening that I could really use some help with. These are probably really easy.... 1) I'm using VB in Access to generate a Visio org chart and then save it to my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.