gc.sh: replace uses of `wc -w` with vcnt
commit1f2dc7c01b7404fe6a1214a13e0e65cc18d54be0
authorKyle J. McKay <mackyle@gmail.com>
Sat, 30 Dec 2017 23:46:00 +0000 (30 15:46 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Sat, 30 Dec 2017 23:46:00 +0000 (30 15:46 -0800)
treecfcb009fc3c06ced7e392e76e1c44d09f3d03747
parent9213aeb26eb58e64f777f2de8a83f7e884f70b46
gc.sh: replace uses of `wc -w` with vcnt

The vcnt function sets the variable named by the first argument to
the count of how many additional arguments are passed.

This is much more efficient to count "words" than spawning a separate
"wc -w" process.

Move the vcnt definition to earlier in the file and replace the
inefficient `wc -w` usage with it.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
jobd/gc.sh