Answers for "check if words are in string bash"

3

check if variable contains string bash

STRING='Hello world'
if [[ $STRING =~ "Hello" ]] ; then echo "It's here" ; fi
Posted by: Guest on April-17-2021
0

bash string match if

#!/bin/bash
# your code goes here
echo "if double helix, type - dh " 
echo "single strand, type - ss"
read htype # this is catching input
echo Structure is $htype ;


if [[ $htype == dh ]];
then
     echo "##dublex#####"
else
    echo "#####single#####"
fi
Posted by: Guest on August-19-2021

Code answers related to "check if words are in string bash"

Browse Popular Code Answers by Language