In case you were wondering, to calculate the square root of a number in a shell script (bash, zsh, etc.), use bc:

bc <<< "scale=3; sqrt(7)"

Don't ask me why I needed to know this, I would like to forget.

#cli #bash

@konst why the scale?
@StephenC if you leave out the scale, the default is to drop the decimal places (not even to round)!
@konst aaah. The old sneaky truncation hidden in a function trap