The substring inside the ` `
must be a valid command itself:
rownum=`echo $nextnum+1 | bc`
But is preferable to use $( )
instead of ` `
:
rownum=$(echo $nextnum+1 | bc)
But there is no need for bc
, the shell is able to do integer arithmetic:
rownum=$((nextnum+1))
Or even simpler in bash
and ksh
:
((rownum=nextnum+1))