Jim Meyering wrote:
> the change below, either remove the leading TABs (my preference)
> and s/-<</<</ or else you'll have to arrange not to trigger
> the leading-TAB-prohibiting syntax check rule.

It's not only about the TAB prohibiting syntax check rule. It's also
about the ease of editing for those among us who have told their
preferred editor to indent with spaces now.

Why can't you write it this way?

sed -e 's/^ *//' > "${tmpf}" <<_EOF_
  1 Y 2 M 3 W 4 d 5 h 6 m 7 s
  P 00010225 T 05:06:07
  P 1Y2M3W4D T 5H6M7S
  1 Y 2 M 25 D 5:6:7
  1 Y 2 M 25 d 5h 6:7
  1 Y 2 M 25 d 5h 6m 7
  P 1-2-25 T 5:6:7
_EOF_

Or, even better in my opinion: All the trouble has been caused my the
desire to keep a shell script and a data table in the same file. Separate
them. Move the test data into a file of its own, say
tests/test-parse-duration-data.txt. Then you don't need a temporary dir,
you don't need a 'trap' command, just a

  while read line < ${srcdir}/test-parse-duration-data.txt
  ...

command.

Bruno


Reply via email to