The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 04-29-2008
yongitz yongitz is offline
Registered User
 

Join Date: Apr 2008
Location: Philippines
Posts: 23
Quote:
Originally Posted by kim187 View Post
a script with prompts user and returns the value of there home directory and full name

#!/bin/bash


echo "please enter your login ID"

read login_id

while $login_id -ne `grep $login_id /etc/passwd | cut -f1 -d:`

is they anything wrong with it
Apart from the useless use of grep and cut, I guess there is something wrong with your expression as you're comparing strings and test operator should be for strings is "!=" instead of "-ne". Correct me guys if I am wrong as I am still a newbie.
Reply With Quote