What would be the best way to check if a particular line (in variable) has an another line (more than 1 char)?
I understand it could be done with 'grep', 'sad', 'awk', by parameter expansion, but all these seems to me havy, worldy, not elegant and overhead in processing
For so common task I would expect something from shell, maybe, close to:
>a="string with piece to search"
>${a??"piece"} && echo "the string has a searched substring" || echo "not found"
... I used here a '??' as a, kind of, search operator (as '?' is used for another action.)
But I do not know anything like that. - Maybe I just do not know?
Otherwise,
what would be your best aproach to perform that simple action?
Thank you!