0

I have this:

normal=$(find dl -type f | wc -l)
reverse=$(find dlR -type f | wc -l)

where both variables have numbers, but when I try to do something like this:

printf "$normal"+"$reverse"

I dont get the values summed up. What mus I do to add both variables?

dominique120
  • 1,170
  • 4
  • 18
  • 31

2 Answers2

1
 printf "$((normal + reverse))\n"; 
Jayesh Bhoi
  • 24,694
  • 15
  • 58
  • 73
1

Try with

printf `expr $num1 + $num2`
evading
  • 3,032
  • 6
  • 37
  • 57