Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. exprList=("24+42" "3*(2+0)")
  4.  
  5. for i in "${exprList[@]}"
  6. do
  7. echo "Computing " $i
  8. bcRes=$(echo $i | bc)
  9. bistroRes=$(echo $i | bc)
  10. echo "BC result : $bcRes"
  11. echo "Bistro result : $bistroRes"
  12.  
  13. if [ "$bcRes" != "$bistroRes"]
  14. then
  15. echo "Failed : $i"
  16. else
  17. echo "Success : $i"
  18. fi
  19. echo ""
  20. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement