Q:

using regex in bash conditional statement

Just appreciate next solution example for your code implementation:
S=finding
if[[ "$S" == *ing ]]; then ...//some code run if string ends with 'ing'
More generally:
if[[ "string_to_check" == regex_patten ]]; then ...//some code
1
pat="[0-9a-zA-Z ]"
if [[ $x =~ $pat ]]; then ...
1

New to Communities?

Join the community