![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| finger | felixwhoals | UNIX for Dummies Questions & Answers | 2 | 12-18-2007 12:35 PM |
| Extracting specific info from finger command | franny | UNIX for Dummies Questions & Answers | 1 | 12-05-2007 01:13 PM |
| help in finger command. | shanshine | Shell Programming and Scripting | 1 | 06-06-2007 11:10 AM |
| How to input username on text file into finger command on shell script | Micz | Shell Programming and Scripting | 3 | 11-08-2005 02:38 AM |
| Using the Finger command in a Script | apolishuk | Shell Programming and Scripting | 4 | 12-02-2003 02:42 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
finger command
Hello all,
Here is what I am trying to do. If a user exist, then send an echo "EXIST" or else "DOES NOT EXIST". (under HP-UX) Kind of: Code:
#!/usr/bin/sh
USER=mylogin
finger $USER
if $? = 0
then
echo "EXIST""
else
echo "DOES NOT EXIST"
fi
Does not work at all. Any idea? |
|
||||
|
Try:
cat /etc/passwd | grep username 1>/dev/null 2>&1 if [ $? != 0 ] then echo user does not exist else echo user does exist fi |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|