* Stefano Lattarini wrote on Wed, Feb 16, 2011 at 12:29:02AM CET: > On Tuesday 15 February 2011, Ralf Wildenhues wrote: > > The space after : is not portable. The sed script could be shortened to > > sed -n "/[^ $tab].*$/{ > > s///p > > d > > }" > > > Did you mean 'q' instead of 'd' here, right?
Yes. Sorry about that. > > It's a bit of a shame this uses a temp file though. awk should be able > > to cope without > > > Yes, if I could assume "new" awk. But traditional awk lacks the 'sub()' > and 'gsub()' builtins, so I really really don't want to go down that road. > Moreover, the use of a tempfile is not a big issue here, because we can > already assume the existence of a temporary working directory (i.e., the > one the test runs in) and of a cleanup trap (installed by `tests/defs'). True. One would assume that it's not common to use more than one function invocation in parallel: deindent foo | deindent > ... or: deindent foo > ... & deindent bar ... > But if you truly truly dislike the use of the tempfile, I could try to > use perl instead... WDYT? That'll slow things down more than using a temp file, so I'm reasonably happy with sed+sed right now. Thanks, Ralf