I am getting the below error on arithmetic values
#!/bin/bash
n=0
line_count=9
line_count=$(line_count)/3
echo $line_count
exit 0
expected result is 3
[]$ ./test.sh
./test.sh: line 4: line_count: command not found
/3
[]$ more test.sh
arithmeticbashshell-script
I am getting the below error on arithmetic values
#!/bin/bash
n=0
line_count=9
line_count=$(line_count)/3
echo $line_count
exit 0
expected result is 3
[]$ ./test.sh
./test.sh: line 4: line_count: command not found
/3
[]$ more test.sh
Best Answer
To complement @Kusalananda's answer, in addition to the standard
sh
syntax:In
bash
you can also use these syntaxes inherited fromksh
(also work inzsh
):bash
(andzsh
) also support:For old pre-POSIX Bourne/Almquist
sh
: