сравнение строк в баше

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#/bin/bash
TARGET=$1
echo $TARGET
if [[ $TARGET == "create-tags" ]]; then
echo "!!!"
fi;
[[ $a == z* ]] # True if $a starts with an "z" (regex pattern matching).
[[ $a == "z*" ]] # True if $a is equal to z* (literal matching).
[ $a == z* ] # File globbing and word splitting take place.
[ "$a" == "z*" ] # True if $a is equal to z* (literal matching).