Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash substring test

#!/bin/bash

STR='GNU/Linux is an operating system'
SUB='Linux'
if [[ "$STR" == *"$SUB"* ]]; then
  echo "It's there."
fi
Source by linuxize.com #
 
PREVIOUS NEXT
Tagged: #bash #substring #test
ADD COMMENT
Topic
Name
3+1 =