%20%EB%AA%A9%EB%A1%9D%EC%9D%98%20%EB%8B%A8%EC%96%B4%20%EC%B0%BE%EA%B8%B0.png)
답변1
그리고 zsh
:
#! /bin/zsh -
words=(foobar foobarbaz STRING)
strings=(fbr STRN xyz)
vowels=aeiouAEIOU # adjust as needed
typeset -A matches=()
for word ($words) {
word_without_vowels=${word//[$vowels]}
for string ($strings)
if [[ $word_without_vowels = $string* ]] matches[$string]+=" $word"
}
for string ($strings)
if (( $+matches[$string] )) print -r -- "$string:$matches[$string]"
다음을 제공합니다:
fbr: foobar foobarbaz
STRN: STRING