ormaaj 1704840212 learn k# function s2p { typeset -n rs ref=$1 ret=$2; shift; typeset IFS=; typeset -i i; typeset -A c; set -- "${!ref[@]}"; set -- "${@/*/ref[\0]}"; for ((i=0; i < 4; ++i)); do c=(); for rs; do c+=([${rs:i:1}]=); done 2>/dev/null; ret+=[${!c[*]}]; done; }; typeset -a s=(.avi .mp4 .mkv .webm); s=("${s[@]##.}"); typeset p; s2p s p; printf '%q ' find . -type f -name "*.${p[*]}" ormaaj 1704942595 forget