princem3
10-14-2003, 09:01 PM
I need some help with the following scripts. ..
So please help me answer the questions for each of the scripts? I'm reading these scripts both for a class and some side project here at home.
#!/bin/sh
usr=$1
What will be the contents of MATCH after the statement is executed?
if MATCH=`grep "^$usr" /etc/passwd`
then
What will the contents of RN be after the statement is executed?
RN=`echo $MATCH | cut -d: -f5`
fi
Why did I assign the output of the grep command to MATCH?
So please help me answer the questions for each of the scripts? I'm reading these scripts both for a class and some side project here at home.
#!/bin/sh
usr=$1
What will be the contents of MATCH after the statement is executed?
if MATCH=`grep "^$usr" /etc/passwd`
then
What will the contents of RN be after the statement is executed?
RN=`echo $MATCH | cut -d: -f5`
fi
Why did I assign the output of the grep command to MATCH?