Dear colleges and friends
As all know theThe following bash syntax verifyverifies if pram isnt zeroparam isn't empty:
[[ ! -z $param ]] For example:
param=””param="" [[ ! -z $param ]] && echo “ I"I am not zero ” No output and its finezero" No output and its fine.
But when param have evenparam is empty except for one (or more) space characters, then the case is different:
param=” ” param=" <--" # one space [[ ! -z $param ]] && echo “I am not zero ” I"I am not zerozero" So my question"I am not zero" is how to define in the brackets to ignore empty spaces (empty spaces will defined as zero )output.
soHow can I change the test to consider variables that contain only in case $param have one character or more then it will be non zero casespace characters as empty?