473,327 Members | 1,892 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,327 software developers and data experts.

not working

77
i have the following code but i don't know what's wrong with it.. can anyone help

the quit command doesn't run..

quit = n

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

currenthardwareinfo="$(info)"
diskspace="$(df)"
software="$(usr/bin)"
processes="$(ps)"

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 " Installed Software: $software"
echo " Processes: $processes"

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) exit;
*) echo "Invalid Choice"


fi

fi

fi

sleep 1
done
Apr 4 '07 #1
2 2164
Mubs
77
i have the following code but i dont know wats rong with it.. can any1 help

the quit command doesnt run..

quit = n

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

currenthardwareinfo="$(info)"
diskspace="$(df)"
software="$(usr/bin)"
processes="$(ps)"

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 " Installed Software: $software"
echo " Processes: $processes"

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) exit;
*) echo "Invalid Choice"


fi

fi

fi

sleep 1
done

sorry this is the code i have...
quit = n

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

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

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 " Processes: $processes"

echo " Press Enter Key to continue"
read ;


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

echo " Press Enter Key to continue"
read ;

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


fi

fi

fi

sleep 1
done
Apr 4 '07 #2
Motoma
3,237 Expert 2GB
Just add something like
Expand|Select|Wrap|Line Numbers
  1. else if [ "$menunumber" -eq "Q") exit;
  2.  
Apr 6 '07 #3

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

Similar topics

6
by: Mullin Yu | last post by:
hi, i have a web service that has file operations on Windows OS, and there may be a file concurrency issue if only one working directory e.g. c:\working therefore, i want to have a unique sub...
5
by: Martin Heuckeroth | last post by:
Hi We are working on a webservice application and are having some problems with the cookies and/or sessions. We have them working on our intranet but then its not working on the internet. We...
5
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
8
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs...
2
by: Don | last post by:
I'm having problems with intellisense, autocomplete, etc. suddenly not working in certain classes of a project I'm working on. All the options are set, and it all works fine for most classes, but...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
4
by: qbproger | last post by:
I'm developing a plugin for some software. The previous version of the software didn't require a start in directory to be set. This allowed me to leave the working directory to the default in the...
3
by: Jason Huang | last post by:
Hi, In our C# Windows Form application, we are using the SQL Server 2000 as the database server. The Database table MyTable has a field RegistrationDate which represents the Date a client comes...
0
by: WORKING IN FAITH | last post by:
three years I LOVE You Monica More options 1 message - Collapse all WORKING IN FAITH View profile More options Nov 13, 11:29 am three years I LOVE You Monica
3
by: lds | last post by:
On our server we have both applications that have been migrated to use v2.0 of the framework as well as apps that have not yet been migrated and still use 1.1. When I tried to deploy my v2.0 app...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.