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
  • 84,225
  • 14
  • 89
  • 153
artnikpro
  • 5,487
  • 4
  • 38
  • 40

1 Answers1

3
if [[ ${#string} != ${#string_two} ]]; then
    run command
fi
HatLess
  • 10,622
  • 5
  • 14
  • 32