help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

expand existing file system entries in one declare


From: alex xmb ratchev
Subject: expand existing file system entries in one declare
Date: Sat, 4 Mar 2023 11:02:56 +0100

just i went over this , my typical short cmd instead of long loops

shopt -s nullglob extglob

 in array= (
@(){<list,list>}
 ) # the entries are @Q escaped

i couldnt make ${*:2@Q} work , says arith err , so the to-find are in f[@]

root@localhost:~#
set -- /tmp/atemp one two three
t=$1 there=two f=( "${@:2}" ) IFS=,
mkdir -p "$t"
cd "$t"
>"$there"
declare -a "ff=( @(){${f[*]@Q}} )"   #here
declare -p ff
cd -
rm -rf "$t"
IFS=$' \t\n'
---

declare -a ff=([0]="two")
/root                                           root@localhost:~#


reply via email to

[Prev in Thread] Current Thread [Next in Thread]