Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- exprList=("24+42" "3*(2+0)")
- for i in "${exprList[@]}"
- do
- echo "Computing " $i
- bcRes=$(echo $i | bc)
- bistroRes=$(echo $i | bc)
- echo "BC result : $bcRes"
- echo "Bistro result : $bistroRes"
- if [ "$bcRes" != "$bistroRes"]
- then
- echo "Failed : $i"
- else
- echo "Success : $i"
- fi
- echo ""
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement