in reply to Re^6: Summing numbers in a file
in thread Summing numbers in a file

> there is no "use strict" in Awk or Bourne-family shells

In larger bash scripts (which should be turned to Perl scripts, really) I always start with

set -eu

and put all code into a main() function, so that I can declare all variables with local. It's not as strict as strict, but it helps a lot.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^8: Summing numbers in a file
by haukex (Archbishop) on Jun 02, 2020 at 21:53 UTC