Re: [PATCH] t6013: replace use of 'tac' with equivalent Perl
Show 19 quoted lines
> 'tac' is not available everywhere, so substitute the equivalent Perl
> code 'print reverse <>'. Noticed by Brian Gernhardt.
>
> Signed-off-by: Thomas Rast <trast@student.ethz.ch>
> ---
>
> Thanks for pointing this out. However, I tried to avoid hardcoding
> those results by recommendation of t/README (last paragraph):
>
> ... If all the test scripts hardcoded the object IDs like
> t0000-basic.sh does, that defeats the purpose of t0000-basic.sh,
> which is to isolate that level of validation in one place. Your
> test also ends up needing updating when such a change to the
> internal happens, so do _not_ do it and leave the low level of
> validation to t0000-basic.sh.
>
> So I would favour this fix. I think this should be ok because we
> depend on Perl anyway.
>
If it isn't, you could always do
sed '1!G;h;$!d'
or
sed -n '1!G;h;$p'
instead.
Both of them are very portable indeed.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231