I have a string variable which could have values like below.
my_string=" "
my_string=" "
my_string="name1"
my_string="name 2"
I have to identify if my_string has only spaces/whitespaces and exit the program when it has only whitespaces. If it has one or two spaces inbetween, it's a valid string.
How to check if the string has only whitespaces and exit the shell script based on that.
Thank you.