I'm learning Shell scripting, I'm trying to write a small script that adds and multi number as shown below But amt value not display
value=212
amt=`expr "( $value * 2 + ( $value * 2 * .075 ) ) " | bc`
echo $amt
I'm learning Shell scripting, I'm trying to write a small script that adds and multi number as shown below But amt value not display
value=212
amt=`expr "( $value * 2 + ( $value * 2 * .075 ) ) " | bc`
echo $amt
First things first. This:
value * 2 + (value * 2 * .075)
is a hot mess, this is equivalent:
value * 43 / 20
Next, I prefer to use awk for this job:
#!/usr/bin/awk -f
BEGIN {
value = 212
print value * 43 / 20
}