shell case

1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh
 
DRINK="beer"
case "$DRINK" in
    "beer") echo "this is beer"
    ;;
    "juice") echo "that is juice"
    ;;
    "coak") echo "Do not drink it"
    ;;
esac

[vagrant@localhost tests]$ sed -i ‘s/\r//’ test.sh
[vagrant@localhost tests]$ ./test.sh
this is beer

esacとか、使い慣れてないなー