Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash scripting string comparison

#!/bin/bash

VAR1="Linuxize"
VAR2="Linuxize"

if [ "$VAR1" = "$VAR2" ]; then
    echo "Strings are equal."
else
    echo "Strings are not equal."
fi
 
PREVIOUS NEXT
Tagged: #bash #scripting #string #comparison
ADD COMMENT
Topic
Name
7+7 =