bug-bash
[Top][All Lists]
Advanced

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

Re: Document m=1 m=2; echo $m result


From: Dennis Williamson
Subject: Re: Document m=1 m=2; echo $m result
Date: Mon, 3 Jul 2023 11:22:09 -0500

On Mon, Jul 3, 2023 at 11:11 AM alex xmb ratchev <fxmbsw7@gmail.com> wrote:

>
>
>
> thats a like 30% or smth
> enuff for me
> i d be the fool typing nonsensly ; s
>

Do what you like, but percentages don't mean anything unless you're running
a lot of assignments in a loop like the artificial conditions in the test I
showed. A few microseconds (the absolute number - not a percentage) really
won't make a difference in very many scripts.

I write for readability and maintainability. Sometimes chaining assignments
(this may have a better name - Bash doesn't support this type: a=$b=$c) or
multiple assignments separated by semicolons makes sense for organization,
etc. But I almost always write one statement per line - command,
assignment, etc. I even put then and do on their own lines (but that's just
a style choice).

-- 
Visit serverfault.com to get your system administration questions answered.


reply via email to

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