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

1 Answer

0 votes
s="bash programming"

if [[ $s == ba* ]] 
then
  echo "yes";
else
  echo "no"; 
fi



 
# run:
#
# yes
#
 

 



answered Jun 27, 2021 by avibootz

Related questions

1 answer 243 views
1 answer 240 views
1 answer 230 views
1 answer 266 views
2 answers 189 views
1 answer 264 views
...