##정수비교

#!/bin/sh
echo " input ? > "
read x
xx=10

if [ $x -gt $xx ]
then 
 echo "$x is more then $xx"
elif [ $x -lt $xx ]
then
 echo "$x is less then $xx"
elif [ $x -eq $xx ]
then
 echo "$x is equal $xx"
fi

#let

#!/bin/sh

a=16
let "a<<=3"
echo "$a"

let "a-=5"
echo "$a"




##select

#!/bin/bash

echo "?ㅼ쓬以??ㅽ겕由쏀듃?몄뼱 ?꾨줈洹몃옒諛띿뿉 ?랁븯??寃껋??"
select var in "?섑봽濡쒓렇?섎컢" "C?꾨줈洹몃옒諛? "?먮컮?꾨줈洹몃옒諛? "Exit"
do
 if [ "$var" = "?섑봽濡쒓렇?섎컢" ]
 then
  echo "correct"
  exit 0
 elif [ "$var" = "Exit" ]
 then
  echo "Exiting...."
  exit 1
 else
  echo "$var ???좏깮?섏뀲?듬땲?? ?ㅻ떟?낅땲??"
  echo "?ㅼ쓬以??ㅽ겕由쏀듃?몄뼱 ?꾨줈洹몃옒諛띿뿉 ?랁븯??寃껋??"
 fi
done



###for

#!/bin/sh

for aaa in you are so beautiful
do
 echo $aaa
done



###else if 다중조건

echo "what is color ?"
read color
if [ "$color" = "white" ]
then
 echo "color is white"
elif [ "$color" = "blue" -o "$color" = "sky" ]
then
 echo "color is blue"

else
 echo "what the fffffffffff"
fi

if [ $S -lt 0 -o $S -gt 100 ]
then
 echo "猷⑥?猷⑥? ?묐컮濡쒖엯?ν븯?몄슂 猷⑥?猷⑥?!"
elif [ $S -ge 90 ]
then
 echo "?뱀떊?€ 泥쒖옱"
elif [ $S -ge 80 ]
then
 echo "?뱀떊?€ ?쇰컲??
elif [ $S -ge 70 ]
then
 echo "醫€?꾪뿕?⑸땲?? 猷⑥???媛€?μ꽦??蹂댁엯?덈떎..."
else
 echo "猷⑥?猷⑥?!"
fi



####case

#!/bin/sh

echo "What is color ?"
read color

case "$color" in
'white')
 echo "color is white"
 ;;
'black')
 echo "color is block"
 ;;
*)
 echo " nonono"
 ;;
esac



###구구단

#!/bin/sh
for aaa in 2 3 4 5 6 7 8 9
do
 for bbb in 1 2 3 4 5 6 7 8 9
 do
  echo "$aaa X $bbb = $(($aaa * $bbb)) "
 done
done




##shift

#!/bin/sh
while [ $# -gt 0 ]
do
 echo $*
 shift
done



### trap

#!/bin/sh
trapper()
{
 echo "in Trapper"
 trap 'echo "caught in a trap~"' 2
}

while :
do
 echo "In the main script"
 trapper
 echo "Still in main"
 sleep 2
done


#trap 2
#!/bin/sh

trap 'echo "control "' 2

while true
do
 echo "asdfasdf"
 sleep 1
done


## data.txt
hong 28 011-222-2222 seoul
park 34 017-333-3333 kyunggi
im 23 019-444-4444 chungnam
son 49 016-555-5555 us
gil 19 018-666-6666 korea
jang 21 011-7777-7777 japan
lee 16 016-8888-8888 china
sa 45 017-9999-9999 canada
hwang 32 015-555-5555  kwangju


AND