0

I have two string variables that I need to compare by length inside of if. So I need to do something like this:

if [ length($string_one) != length($string_two) ]:

fi
Cyrus
  • 77,979
  • 13
  • 71
  • 125
artnikpro
  • 5,026
  • 3
  • 33
  • 37

1 Answers1

2
if [[ ${#string} != ${#string_two} ]]; then
    run command
fi
HatLess
  • 5,048
  • 4
  • 8
  • 28