You are viewing a single comment's thread. Return to all comments →
a=($(cat))
p=(${a[@]/* a */})
echo ${p[@]}
i set the input as array a
then i edited array a into a new array p, removing all instances of "a", as well as the characters before and after "a". (remove the spaces in * a *)
then i used echo to show me the new array p
does this one make sense
Seems like cookies are disabled on this browser, please enable them to open this website
Filter an Array with Patterns
You are viewing a single comment's thread. Return to all comments →
a=($(cat))
p=(${a[@]/* a */})
echo ${p[@]}
i set the input as array a
then i edited array a into a new array p, removing all instances of "a", as well as the characters before and after "a". (remove the spaces in * a *)
then i used echo to show me the new array p
does this one make sense