Re: [COGITO PATCH] Optimized print_help()

From: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Date: 2005-06-16 04:58:55
Pavel Roskin schrieb:
>>> +	cat $toolpath | sed -n '3,/^$/s/^# *//p'
>> 
>> What about also removing UUOC from this line ...
> 
> 
> UUOC?  I had too look it up :-)
> 
> It's not just "useless use of cat", but also useless use of
> redirection in both cases.  I guess sed can exit after it finishes
> processing the range (I don't know if it actually does), so feeding
> it the whole file is not need.

It doesn't matter if the shell opens the file or if sed does it itself,
sed's ability to close the file and quit when done doesn't depend on
that.  So this call is equivalent and has the advantage of being
resistant against filenames starting with a "-":

   sed -n '3,/^$/s/^# *//p' <"$toolpath"

Rene
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Thu Jun 16 04:59:18 2005

This archive was generated by hypermail 2.1.8 : 2005-06-16 04:59:19 EST