We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e6741d9 commit 975d9f7Copy full SHA for 975d9f7
learningbash.md
@@ -120,3 +120,15 @@
120
- echo `$?`: to print the exit status of the last executed command.
121
- `test 1 -eq 1`, followed by echo `$?`: will print 0.
122
- `test 1 -eq 1` is same as `[ 1 eq 1 ]`, using two brackets, we are allowed to use more operators: `[[ 1 = 1 ]]`
123
+- `(())` are used to do matematical calculation:
124
+ ```
125
+ f=$((1+1))
126
+ ((c=3+5))
127
+ echo $f
128
+ echo "c equal to $c"
129
130
+- for floating point calculatio, we need to use the `bc` command as follows:
131
132
+ d=$(echo "1.2 + 1.3" | bc)
133
+ echo "d equal to $d"
134
0 commit comments