Horje
substring if statement variable shell script Code Example
bash substring test
#!/bin/bash

STR='GNU/Linux is an operating system'
SUB='Linux'
if [[ "$STR" == *"$SUB"* ]]; then
  echo "It's there."
fi
Source: linuxize.com
substring if statement variable shell script
if echo "$string" | grep 'foo'; then
  echo "It's there!"
fi
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: linuxize.com




Shell

Related
reaect native reactotron Code Example reaect native reactotron Code Example
update node Code Example update node Code Example
check osx version Code Example check osx version Code Example
how to remove a software from linux Code Example how to remove a software from linux Code Example
k8 delete deployment Code Example k8 delete deployment Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12