start with in shell script 1

start with in shell script

# The == comparison operator behaves differently within a double-brackets
# test than within single brackets.

[[ $a == z* ]]   # True if $a starts with a "z" (wildcard matching).
[[ $a == "z*" ]] # True if $a is equal to z* (literal matching).

Here is what the above code is Doing:
1. The first test is true if $a starts with a “z”.
2. The second test is true if $a is equal to “z*”.

The first test uses wildcard matching, and the second uses literal matching.

The == operator is a pattern-matching operator when used with the [[ ]]
construct.

When the == operator is used with the [ ] construct, it performs a string
comparison.

Similar Posts