I’m just looking for an easy way to divide a number (or provide other math functions). Let’s say I have the following command:
find . -name '*.mp4' | wc -l
How can I take the result of wc -l and divide it by 3?
The examples I’ve seen don’t deal with re-directed out/in.
Using
bc:In contrast, the bash shell only performs integer arithmetic.
Awk is also very powerful:
You don’t even need
wcif usingawk: