The grep -c output command?

From: Russell Johnson <rkj_at_loyno.edu>
Date: Sat, 24 Jan 1998 15:15:30 -0600 (CST)

Gurus,
Is there anyway to make an if statement with grep -c
so if 0 will print to a file?
for username in `cat /home/root/alist `
do
 if [ grep -c -E $username /home/root/reallist ]
 then
 echo $username >> try.1
 fi
done
thanks,
 
                                 \\\\|////
                                  ! ^ ^ !
                    \\\|/// ( O O )
                  \\ - - // ( | )
                   ( _at_ _at_ ) (o)
+-----------------oOOo-(_)-oOOo---oOOo---oOOo--------+
| Russell Johnson Loyola University |
| rkj_at_loyno.edu of New Orleans |
| tel:504.865.2792 fax:504.865.2875 |
+-------------------------Oooo-----------------------+
                   oooO ( ) [ } \
                  ( ) ) / [ | |
                   \ ( (_/ [ | |
                    \_) [ | /
                                 oooO)( ~~~~)
                                            
Received on Sat Jan 24 1998 - 22:18:55 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:37 NZDT