Martin Klingensmith wrote: > Nate Duehr wrote: > >> :-) >> >> Anyone interviewing someone for a Unix job -- apparently what the >> above is -- who said that using an array in the shell directly versus >> using a bunch of pipes and an ls command, is a) behind in their >> skillset, and b) closed-minded. >> >> On the flip side, anyone who stubbornly wouldn't try to do the job the >> way the new boss wanted it done during the interview process, no >> matter how backwards/stupid it was, is also stupid -- in a different >> way. Being "elitist" to the point of not getting the job, is pretty >> silly unless the ae88925 person has plenty of job offers on the >> table. Can't really tell the whole story from the snippet of >> discussion without more context. >> >> The above discussion could be dissected in a number of ways. And even >> then, the real issue may have been a personality clash between the >> interviewer and interviewee. You can't tell. >> >> -- >> Nate Duehr >> nate@natetech.com >> >> > The point was that the interviewer told the candidate that they had to > use ls. Now we don't know if that was a constraint ahead of time, but I > interpreted that it was not. If you solve a problem using a solution > that works, I cannot argue with you that you should have done it my way. > If I wanted it done my way I would have done it myself right? I can only > tell you why my way might be better. > > Personally, I like the find utility =) > > - > MK > IANABOFH, but I'll add because this is OT anyway: Using ls or shell completion are both bad ways of doing an operation on each file because you could have perhaps 1000+ files in your directory. If you need to execute an operation on a long list of files you should use the find command and either the -exec option, or create a list in a temporary file and read each line when you continue your script. find -exec echo {} \; find -type d -exec echo {} \; find -type d > list; cat list | while read line; do { find "$line" | wc -l; echo " $line"; }; done; I did a lot of this to manually remove 30,000 "hinet.net" spam from my mail queue, and to unsort my mp3s that iTunes sorted for me (Thanks.) - MK -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist