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
My employer doesn’t want me using SED or AWK.
Also temp variables wont do as the system is restarted every 2hrs, and the process am trying to achieve has to be automated.
Any tips or suggestions will greatly appreciated.
Change employer, he sounds like a teacher by giving you arbitary restrictions.
if am not using SED or Awk, i have no idea what am doing in these situations.
Perl, C, C++, Python, Pascal, Fortran, Java, ....
If an employer says write a UNIX script but don't use sed then that is called micro-managing. If a teacher says that it's because he wants you to grasp certain concepts.