I am in need of some assistance I cannot for the life of me seem to understand bash case statements. What I'm trying to do is to get input from the user, their annual income, and reply back with their respective tax bracket. But i cannot seem to get the cases to work with a range of numbers. Any help is greatly appreciated. thanks. Here is my code so far:
#!/bin/bash
echo -e "What is your annual income? "
read annual_income
case $annual_income in
0) echo "You have no taxable income." ;;
[24100-42199]) echo "With an annual income of $annual_income, you are in the lowest income tax bracket with a total effective federal tax rate of 1.5%." ;;
[42200-65399]) echo "With an annual income of $annual_income, you are in the second income tax bracket with a total effective federal tax rate of 7.2%." ;;
[65400-95499]) echo "With an annual income of $annual_income, you are in the middle income tax bracket with a total effective federal tax rate of 11.5%." ;;
[95500-239099]) echo "With an annual income of $annual_income, you are in the fourth income tax bracket with a total effective federal tax rate of 15.6%." ;;
[239100-1434900]) echo "With an annual income of $annual_income, you are in the highest income tax bracket with a total effective federal tax rate of 24%." ;;
esac