HOMEWORK HELP - URGENT


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting HOMEWORK HELP - URGENT
# 1  
Old 09-28-2010
HOMEWORK HELP - URGENT

im suppose to write a script that examine how many users are logged in the student server. if there are less than 10 logged in a message suppose to display that says "there are less than 10 users currently signed on" and if there are more than 10 logged in a message suppose to display that says "There are currently ### users signed on the server" the ### is the number of users logged in

this is what i have so far

clear
user= 'who | wc -l'
if [ "$user" -lt 10 ]
then
echo "There are less than 10 users currently signed on"
fi
if [ "$user" -gt 10 ]
then
echo "There are currently \c users signed on the server"
fi


can someone give me an idea on how to fix this????
# 2  
Old 09-28-2010
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies

2. Shell Programming and Scripting

Urgent !

Input A,Plan name ,L,M,B,Service Name,Pricing Rule,From Unit,To Unit, DISTI(USD) , MSRP(USD) , DIST(EUR) , MSRP(EUR) , EMEA-DISTI(USD) , EMEA-MSRP(USD) , GLOBAl-DISTI(USD) , GLOBAL-MSRP(USD) , DISTI(GBP) , MSRP(GBP) C1,P1,L1,M1,1,S1,Standard,1,,255,300,187.85,221,255,300,255,300,151.3,178... (1 Reply)
Discussion started by: r_t_1601
1 Replies

3. Linux

urgent

Dear All, plz print the path of files which have the script of "who" & "w" commands. thnx in advance. (1 Reply)
Discussion started by: saqlain.bashir
1 Replies

4. Shell Programming and Scripting

Urgent need help

My requirement is, I have to search a file(list of files) from my local unix enviroment to remote server and if the files are present and that is not older than 1 day ftp the the files to the local server. Please share your thoughts as soon as possible as it is urgent!!! the script which i am... (1 Reply)
Discussion started by: mitsvipingupta
1 Replies

5. UNIX and Linux Applications

urgent help

i have this error plz help me File does not exist: /home/www/www.chat-land.org/ticket/images, referer: http://www.chat-land.org/ticket (1 Reply)
Discussion started by: abir2
1 Replies

6. HP-UX

Urgent Please Help

Hi, One job got failed in my HP Unix server. Now i just want to know whether the command has been executed or not? How to find the executed commands list? Thanks in Advance (1 Reply)
Discussion started by: msgobinathan
1 Replies

7. Shell Programming and Scripting

Urgent

Hello guys, I have a file look this. I have just posted a segment of it. I want to replace "PW" from 4th column by TRP. How do I do it? Pls help. thanks advance parimal ATOM 2817 HB3 GLU 180 0.545 12.520 1.097 0.00 0.00 ATOM 2818 CG GLU 180 0.269 14.467 ... (6 Replies)
Discussion started by: chuchu
6 Replies

8. UNIX for Advanced & Expert Users

URGENT,URGENT- Need help tape drive installation

Hi, I am trying to attach tape drive to sun V890 running Solaris 9 on it. I have installed HBA(qlogic) in slot 1 of 0-8 slots and booted the system. I do not see HBAin prtdiag output. The tape drive is not attached to HBA. The tape drive I am going to attach is Sony AIT3. 1.How can I make... (3 Replies)
Discussion started by: sriny
3 Replies

9. AIX

Need Urgent Help

Hi, I am a new Chap to AIX. I am currently involved in a work of porting an application that is running on HP-UX 9000 Series to AIX 5.3,I want to know whether the PRO*C Code written and compiled with HP AC++ Compiler will work fine without any Code changes in Visual Age C++ Compiler. If... (0 Replies)
Discussion started by: balasubramaniam
0 Replies
Login or Register to Ask a Question