I have the script below to subtract the counts of files between two directories but the COUNT= expression does not work. What is the correct syntax?
COUNT=
<
White space is important, expr expects its operands and operators as separate arguments. You also have to capture the output. Like this:
expr
COUNT=$(expr $FIRSTV - $SECONDV)
but it's more common to use the builtin arithmetic expansion:
COUNT=$((FIRSTV - SECONDV))