Reputation: 2994
I want to write
level=$( echo "scale=0; ( 254 * ( if ( $1 > 100 ) { 100 } else { $1 } ) ) / 100" | bc )
but it appears to be impossible. Is this so?
Upvotes: -1
Views: 39
Reputation: 2994
Use awk
instead:
awk "BEGIN { if ( $h < 13 ) { print 13 - $h } else { print 1 }; exit }"
Upvotes: -1