On 09/17/2010 01:38 PM, Junio C Hamano wrote: > Agreed; the less use of 'cut' we see, the better ;-) Double agreed. > As to portability guideline in our shell script: > > ${param#word} ${param##word} ${param%word} ${param%%word} > > are permissible POSIX constructs (together with more traditional -/=/?/+), and > their use is encouraged over 'cut', 'expr', etc. [*1*] > > ${param:ofs} ${param:ofs:len} ${param/pattern/string} > > are bashisms we avoid (unless of course in the bash completion script). It's been a long while since I've reviewed Documentation/CodingGuidelines, but these are indeed in there, and have been for a very long time. Maybe I should refresh my memory more often. :) > We do not seem to use ${#param}, not because it is forbidden, but I think > because it is not very useful without ${param:ofs:len}. CodingGuidelines does say "No strlen ${#parameter}", so that could be part of the reason. But like you say, it's not very useful without ${param:ofs:len}. -Brandon -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html