i made a script like always for it, but to my surprise it doesnt work
./*.xz
is there, but it doesnt return anything
from three @(..) extglobs
@(./)@(*.)@(xz|other)
is this a lack of glob inside @( ?
without args my script behaves like ./ and *
out of three possibilities, pre mid and stu, separated by -- arg
bash -x pattern2 ./ -- '*.' -- xz bin
#!/bin/bash
shopt -s extglob dotglob globstar nullglob
mode=0 IFS=\|
for arg ; do
[[ $arg == -- ]] && {
(( mode++ ))
continue
}
declare -a "mode_$mode+=( ${arg@Q} )"
done
mklist() {
declare -g "$1=@(${*:2})"
}
mklist pre "${mode_0[@]:-./}"
mklist mid "${mode_1[@]:-*}"
mklist stu "${mode_2[@]}"
#printf '%s\n' "$pre$mid$stu"
printf '%s\n' $pre$mid$stu
#eval "printf '%s\n' $pre$mid$stu"
On Sat, Jul 24, 2021 at 6:29 PM <dora-solomon@brusseler.com> wrote:
>
>
> I want to pass a list of filename suffixes to a bash script. Need also to
> accept CVS with filename
>
> suffixes ,v and the usual period (dot) suffixes ( e.g. .c .f ). But perhaps
> there are other filename
>
> suffixes to accept, or else accept any pattern.
>
>