Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

compare strings shell

#!/bin/bash

read -p "Enter first string: " VAR1
read -p "Enter second string: " VAR2

if [[ "$VAR1" == "$VAR2" ]]; then
    echo "Strings are equal."
else
    echo "Strings are not equal."
fi
Comment

bash compare two strings

if [ "$s1" == "$s2" ]
then
	stuff
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: git remove an empty commit 
Shell :: reset password postgres ubuntu 
Shell :: get program path powershell 
Shell :: flutter run 
Shell :: how to install path adb 
Shell :: what does %! mean vim 
Shell :: enable ssh on ubuntu 20.04 
Shell :: install carla for manjaro 
Shell :: how to start xfce4 sudo command 
Shell :: permission to var/cache 
Shell :: colcon reset build 
Shell :: installing statasmodels in anaconda 
Shell :: install kali synaptic software manager 
Shell :: How can i get batch files to run through the new window terminal 
Shell :: terminal make directory and enter in the same time 
Shell :: how to see running commands linux 
Shell :: bash change variable in while loop 
Shell :: git add cloud repo 
Shell :: Warning: Broken symlinks were found. Remove them with `brew cleanup`: 
Shell :: ubuntu-not-enough-space-on-tmp/ 
Shell :: Zim files from command prompt 
Shell :: sftp with private key cli 
Shell :: create a tag locally 
Shell :: winmerge command line generate report 
Shell :: github extension for visual studio 2019 vs git scm 
Shell :: gastby yarn install 
Shell :: heroku process 
Shell :: how to start hiveserver2 manually 
Shell :: powershell script clear cach at end 
Shell :: ubuntu compressed extract 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =