help-bash
[Top][All Lists]
Advanced

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

how to declare -n from arguments ?


From: alex xmb sw ratchev
Subject: how to declare -n from arguments ?
Date: Tue, 9 Jul 2024 00:33:47 +0200

i try , small simplifications along ..

say i have i= , then while (( ++i <= $# ))
and here i want the -n way , to test
instead n=${!i}
for one declare -n before the loop

but i cant get any code working ..

~ $ declare -n n=\!i
bash: declare: `!i': invalid variable name for name reference

declare -n n=@\[i]
bash: declare: `@[i]': invalid variable name for name reference

declare -n n=i
~ $ i=2
~ $ set 01 02 03
~ $ printf $n\\n
2

thxx for help ..
= ))


reply via email to

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