help-bash
[Top][All Lists]
Advanced

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

Re: feature todo .. be able to unset vars at assignment stage , without


From: alex xmb sw ratchev
Subject: Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment
Date: Thu, 22 Feb 2024 16:16:02 +0100

On Thu, Feb 22, 2024, 16:01 alex xmb sw ratchev <fxmbsw7@gmail.com> wrote:

>
>
> On Wed, Feb 21, 2024, 22:38 Chet Ramey <chet.ramey@case.edu> wrote:
>
>> On 2/21/24 2:54 PM, alex xmb sw ratchev wrote:
>>
>> > I find it a bit difficult to understand what you are asking for.  Could
>> >> you please provide a more detailed example of what you are trying to
>> do,
>> >> and what the potential benefits of the feature would be?
>> >>
>> >
>> > many codes can be done via variable assignment , chained well speedy
>>
>> OK. What's the use case for this?
>>
>
> chaining assign-only statements ,
> inside those i was trying conditional assignments , for different code
> running then ..
> say one checks for beginning / in string , another if an $arr is empty ..
> .. and do run assign with different contents ..
>
> i met i think a few [[ or (( if's that can be incorporated into assign
> only code
>
> a unset feature would extend this programming ability
>
>
>
> >
>> > case like .. im sorry im stuck struggling hours on code or english ,
>> casing
>> >
>> > say i wanna do major here and there with assigments only
>>
>> Why? What advantage does that provide?
>>
>
> i try sometimes to code this way , many assigns , for learning if this
> style is any good ..
>
> also a major point is speed , i suppose assign only codes could yield some
> speed up
> not sure but i hope for it
>

another small point for it is being able to restore variable states fully
i can save states with declare -p , and then restore by running that cmd ,
or if declare exited non null run unset -v cause it was no existing var ..

this in assigning step , no long muticommands ..

-- 
>> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>>                  ``Ars longa, vita brevis'' - Hippocrates
>> Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/
>>
>>


reply via email to

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