I have a question though, the “while read line” statement, how does this get information from the file, is it from this “done < "file"”?.
sorry if am asking silly questions i only been using UNIX for a week now :P
also can i use the grep to achieve this, if say i will be looking for occurrences of the current user who is executing the script?(in this case it should be me, but i can use it for others)
cat xx| grep -n .\*| grep "^1"
or something like that, i cant test it atm, but i think cat pipes file to 'grep -n' which inserts line numbers and pipes it to 'grep '^1' which gets the line 1. odds are this might fail as this is 1st time i am going to use grep