Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- val=`expr 786 + 240`
- echo "Sum of 240 and 786: $val"
- one= 786
- two= 240
- `expr $one + $two`
- `expr $one - $two`
- `expr $one \* $two`
- `expr $one / $two`
- [ $one == $two ]
- [ $one -eq $two ]
- [ $one -ne $two ]
- [ $one -gt $two ]
- [ $one -lt $two ]
- [ $one -ge $two ]
- [ $one -le $two ]
- _______________________________________
- #!/bin/sh
- for i in 1 2 3 4 5
- do
- echo "Looping ... number $i"
- done
- _______________________________________
- #!/bin/sh
- INPUT_STRING=hello
- while [ "$INPUT_STRING" != "bye" ]
- do
- echo "Please type something in (bye to quit)"
- read INPUT_STRING
- echo "You typed: $INPUT_STRING"
- done
- _________________________________________________
- #!/bin/sh
- echo "Please talk to me ..."
- while :
- do
- read INPUT_STRING
- case $INPUT_STRING in
- hello)
- echo "Hello yourself!"
- ;;
- bye)
- echo "See you again!"
- break
- ;;
- *)
- echo "Sorry, I don't understand"
- ;;
- esac
- done
- echo
- echo "That's all folks!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement