| 1 | #!/bin/bash |
| 2 | # case-cmd.sh: Using command substitution to generate a "case" variable. |
| 3 | |
| 4 | case $( arch ) in # $( arch ) returns machine architecture. |
| 5 | # Equivalent to 'uname -m' ... |
| 6 | i386 ) echo "80386-based machine";; |
| 7 | i486 ) echo "80486-based machine";; |
| 8 | i586 ) echo "Pentium-based machine";; |
| 9 | i686 ) echo "Pentium2+-based machine";; |
| 10 | * ) echo "Other type of machine";; |
| 11 | esac |
| 12 | |
| 13 | exit 0 |