[b][red]This message was edited by the CS_Smooth at 2002-4-20 8:28:56[/red][/b][hr]
Challenge Problem for Bourne Shell
The following script is an attempt to count the number of accounts in the lab that have the C shell as the default shell.
It does not work because the value of COUNTER inside the while loop is only available inside a child shell process and not available outside that loop.
If someone knows a way to get this to work, I'll be very thankfull.
ypcat passwd |
while read user epass usid grid com hdir dsh
if [ "$dsh" = "/bin/csh" ]
COUNTER=`expr $COUNTER + 1`
echo "Number of users with default C shell: $COUNTER"