Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo enter two words
- read a b
- numa=$(echo $a |wc -c)
- numb=$(echo $b |wc -c)
- if [ "$numa" -eq "$numb" ]
- then
- echo equal length
- else
- if [ "$numa" -gt "$numb" ]
- then
- echo $a is longer
- else
- echo $b is longer
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement