#!/bin/bash MAX=5400 PRICE=200 UNIT=30 echo "Enter seconds:" while read USED; do if (( $USED < 5400 )); then echo "You're inside the limit; pay me $(($USED*$PRICE/$UNIT)) cents!" else echo "Hey, you're out of bounds!" fi done exit 0
Enter seconds: 90 You're inside the limit; pay me 600 cents! 6000 Hey, you're out of bounds!
customerA|time in s|amount custA|60|400
custA|60|400 ...
awk -F"|" '$3 > 400' infile