Строка труб Linux содержит
[[ $string == *foo* ]] && echo "It's there" || echo "Couldn't find"
DreamCoder
[[ $string == *foo* ]] && echo "It's there" || echo "Couldn't find"
[ $(expr $mystring : ".*${search}.*") -ne 0 ] && echo 'yes' || echo 'no'
# For null cmd arguments checking
to_check=' -t'
space_n_dash_chars=' -'
[[ $to_check == *"$space_n_dash_chars"* ]] && echo found