bash4 - How can you search for a char in a string in bash? -


if have string var="root/desktop", how can determine whether var var contains '/' character?

bash can match against regular expressions =~, try:

[[ $var =~ "/" ]] && echo "contains slash" 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -