How to check if a string ends with another string in Bash

1 Answer

0 votes
s="bash programming"
 
if [[ $s == *ing ]] 
then
  echo "yes";
else
  echo "no"; 
fi
 
 
 
  
# run:
#
# yes
#

 



answered Jun 28, 2021 by avibootz

Related questions

1 answer 209 views
1 answer 224 views
1 answer 212 views
1 answer 252 views
2 answers 173 views
1 answer 248 views
...