Am 27.02.22 um 13:24 schrieb Shubham Mishra: > test_expect_success \ > 'text plus spaces without newline at end should not show spaces' ' > - ! (printf "$ttt$sss" | git stripspace | grep " " >/dev/null) && > - ! (printf "$ttt$ttt$sss" | git stripspace | grep " " >/dev/null) && > - ! (printf "$ttt$ttt$ttt$sss" | git stripspace | grep " " >/dev/null) && > - ! (printf "$ttt$sss$sss" | git stripspace | grep " " >/dev/null) && > - ! (printf "$ttt$ttt$sss$sss" | git stripspace | grep " " >/dev/null) && > - ! (printf "$ttt$sss$sss$sss" | git stripspace | grep " " >/dev/null) > + printf "$ttt$sss" | git stripspace >tmp && > + ! grep " " tmp >/dev/null && > + printf "$ttt$ttt$sss" | git stripspace && > + ! grep " " tmp >/dev/null && > + printf "$ttt$ttt$ttt$sss" | git stripspace && > + ! grep " " tmp >/dev/null && > + printf "$ttt$sss$sss" | git stripspace && > + ! grep " " tmp >/dev/null && > + printf "$ttt$ttt$sss$sss" | git stripspace && > + ! grep " " tmp >/dev/null && > + printf "$ttt$sss$sss$sss" | git stripspace && > + ! grep " " tmp >/dev/null > ' You forgot to redirect all but the first `git stripspace`. > > test_expect_success \ > @@ -282,12 +292,18 @@ test_expect_success \ > > test_expect_success \ > 'text plus spaces at end should not show spaces' ' > - ! (echo "$ttt$sss" | git stripspace | grep " " >/dev/null) && > - ! (echo "$ttt$ttt$sss" | git stripspace | grep " " >/dev/null) && > - ! (echo "$ttt$ttt$ttt$sss" | git stripspace | grep " " >/dev/null) && > - ! (echo "$ttt$sss$sss" | git stripspace | grep " " >/dev/null) && > - ! (echo "$ttt$ttt$sss$sss" | git stripspace | grep " " >/dev/null) && > - ! (echo "$ttt$sss$sss$sss" | git stripspace | grep " " >/dev/null) > + echo "$ttt$sss" | git stripspace >tmp && > + ! grep " " tmp >/dev/null && > + echo "$ttt$ttt$sss" | git stripspace >tmp && > + ! grep " " tmp>/dev/null && > + echo "$ttt$ttt$ttt$sss" && > + ! grep " " tmp >/dev/null && > + echo "$ttt$sss$sss" | git stripspace >tmp && > + ! grep " " tmp >/dev/null && > + echo "$ttt$ttt$sss$sss" | git stripspace >tmp && > + ! grep " " tmp >/dev/null && > + echo "$ttt$sss$sss$sss" | git stripspace >tmp && > + ! grep " " tmp >/dev/null > ' A superficial glance at the visual pattern formed by the new lines reveals immediately that there is something foul. And indeed, one of the rewritten cases misses `| git stripspace >tmp`. -- Hannes