Thank you, it is good: last 2 are pretty nice, the 'case' is interesting, too, but little wordy.
Neither one way did come to my mind.
In my bash the match operator works; so it is best:
Code:
> a="string with piece to search"
> [[ $a =~ piece ]] && ec da || ec net
da
>
Appreciate your addvice!