Advertisement
999ms

5.60

Apr 4th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.22 KB | None | 0 0
  1. echo enter two words
  2. read a b
  3. numa=$(echo $a |wc -c)
  4. numb=$(echo $b |wc -c)
  5. if [ "$numa" -eq "$numb" ]
  6. then
  7. echo equal length
  8. else
  9. if [ "$numa" -gt "$numb" ]
  10. then
  11. echo $a is longer
  12. else
  13. echo $b is longer
  14. fi
  15. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement