help-gnuzilla
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: makeicecat fails for a miscalculation of the version of rename


From: bill-auger
Subject: Re: makeicecat fails for a miscalculation of the version of rename
Date: Sat, 11 Feb 2023 23:09:06 -0500

if it works, the only criticism would be that the sed command
is difficult to understand - OTOH, even so, this approach is
better than requiring the rename tool (which itself, is probably
_more_ difficult to understand)

IIRC, the purpose was to rename files named like 'Firefox' to
'Icecat'? - its not obvious how that sed command manages to do that

sed commands are generally brittle - i would extend the focus to:
"if it always works, or else fails gracefully" - whenever i use sed,
i follow it with a `grep` to verify that it did the right thing,
as a precaution (albeit ugly) - in this case, something like:

  if   find . | grep -i firefox
  then echo "sed rename needs re-working"
       exit 1
  fi

even if that is a pointless check (it would never catch anything),
it "reads" well (makes the intention obvious), like a comment



reply via email to

[Prev in Thread] Current Thread [Next in Thread]