I've an array coming from the output of a command:
array=(saf sri trip tata strokes)
Now I want to filter items based on user input. The user can also use wildcards, so if the user enters *tr*
, the output should be
trip strokes
I've an array coming from the output of a command:
Now I want to filter items based on user input. The user can also use wildcards, so if the user enters
|
||||
It's easier with
|
|||
|
One way to do it:
|
|||
|
tr
with no wildcard? Nothing? – terdon♦ 9 hours ago