You might just take ${var#-}.
${var#Pattern}Remove from$varthe shortest part of$Patternthat matches the front end of$var. tdlp
Example:
s2=5; s1=4
s3=$((s1-s2))
echo $s3
-1
echo ${s3#-}
1
You might just take ${var#-}.
${var#Pattern}Remove from$varthe shortest part of$Patternthat matches the front end of$var. tdlp
Example:
s2=5; s1=4
s3=$((s1-s2))
echo $s3
-1
echo ${s3#-}
1