Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash substring test

#!/bin/bash

STR='GNU/Linux is an operating system'
SUB='Linux'

case $STR in

  *"$SUB"*)
    echo -n "It's there."
    ;;
esac
Source by linuxize.com #
 
PREVIOUS NEXT
Tagged: #bash #substring #test
ADD COMMENT
Topic
Name
8+8 =