help-bash
[Top][All Lists]
Advanced

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

Re: how to declare -n from arguments ?


From: alex xmb sw ratchev
Subject: Re: how to declare -n from arguments ?
Date: Tue, 9 Jul 2024 18:58:19 +0200

On Tue, Jul 9, 2024, 16:12 Zachary Santer <zsanter@gmail.com> wrote:

> On Mon, Jul 8, 2024 at 7:51 PM alex xmb sw ratchev <fxmbsw7@gmail.com>
> wrote:
> >
> > ill do on func call args=( '' "$@" ) and do args and i in -n
>
> Nothing's stopping you from doing this, if you really want to:
>

thank you for supporting ..
i finished the implentation
one function 'ds' ( display set ) to set and print var defaults
but i just see bugs i need to recode
i wanna show what i coded tho
.. for simple defaults its simple , but i really need to think of some
interaction more with the vars


~ $ bash xmb.ffhiqa.0
demo
var1=val1       var2=val2
var3=val3

its going to be ' ff hi quality audio ' script , with at least 20 , 30 vars
to default , and print for user

greets ..


declare -i i=0
> while (( i < ${#} )); do
>   (( ++i ))
>   printf '%s\n' "${@:i:1}"
> done
>
> Could easily be modified to go through arguments backwards, for
> instance. Something 'for arg in "${@}"' can't do.
>

Attachment: xmb.ffhiqa.0
Description: Binary data


reply via email to

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