Anders Johansson wrote:
On Saturday 03 December 2005 20:54, Lawrence Bowie wrote:
Anders Johansson wrote:
On Saturday 03 December 2005 20:24, Lawrence Bowie wrote:
David, was your question answered? He already mailed me off-list to tell me my solution worked OK .. Well.. good job ... glad it worked .. it worked my way as well because i tried before sending it. :)
I never said your way wouldn't work, I said it's sort of overkill and unnecessary to use three programs where one will do.
for i in `ls *`
by the way is a classic mistake, since
for i in *
will accomplish the exact same thing without launching a new process. Randall Schwarz used to hand out the 'Usenet Useless use of cat' award to people who did things like
cat foo.txt|grep bar
and the use of `ls *` in your script is of the same calibre. If one program can do two things, why use two programs. Especially since you have to use the one anyway
The original page documenting this award seems to have gone away, but here is a cached version
http://www.t72.ru/~rz/txt/awards.html
The use of sed is of course even more overkill
Yes, I agree with you. There was a better way ... but I hardly classify it as mistake since it worked. It is just a matter of preference at that particular moment in time. If had asked for an efficient way of performing the operation, then I would have done something different. If you want to hear, "Anders, you win the efficient scripting award", then, "Anders, you won the efficient scripting award --certifed by LDB". If not, then just let it go. We are here to help each out and we helped him in our own little way. In your case, you helped him a lot. :) Later man .. You will NOT hear from me on this thread again. :) Thanks, LDB