The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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
TAHI Test Suite 3.0.13 (IPv6 Conformance Test Tool branch) iBot Software Releases - RSS News 0 04-06-2008 09:20 AM
Test.... Kaminski UNIX for Dummies Questions & Answers 3 02-09-2008 07:21 AM
test and .test in same directory vikashtulsiyan SUN Solaris 14 12-27-2007 10:25 PM
Test : Which OS are you ? sysgate What's on Your Mind? 8 08-29-2007 03:36 PM
Keithley Introduces Linux-Based RF Parametric Test Systems - Test and Measurement.com iBot UNIX and Linux RSS News 0 07-23-2007 07:30 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-06-2008
Read Only
 

Join Date: Apr 2008
Posts: 12
test

I am running a test command and if the user is not found you have to type exit and it wiil exit. Ok I did that. But if the user is found it is supposed to finger them. But my problem is it makes you type exit first then it fingers them. Why? whats wrong?

Code:
if [ -z username ] 
then
error_fn
else
echo "Please try again or type exit to quit"
read exit"
if grep "$username" /etc/passwd
then
finger "$username"
fi
fi
I must have something switched around huh?

Last edited by Yogesh Sawant; 04-07-2008 at 01:02 AM. Reason: added code tags
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-07-2008
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Code:
if [ -z username ] 
then
      error_fn
else
      echo "Please try again or type exit to quit"
      read exit"
      if grep "$username" /etc/passwd
      then
            finger "$username"
     fi
fi
Adding in spacing may help you see the problem easier.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:21 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0