[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Avoiding setting same variables multiple times
From: |
Greg Wooledge |
Subject: |
Re: Avoiding setting same variables multiple times |
Date: |
Wed, 7 Apr 2021 14:17:42 -0400 |
On Wed, Apr 07, 2021 at 07:57:30PM +0200, pauline-galea@gmx.com wrote:
> Is there any neat way to set the variables but not end
> up setting them multiple times?
Call the init function once, explicitly, at the beginning of the
script.
A compromise approach would be to check one of the variables, and call
the init function only if it's unset/empty.
Also, while you're at it, consider not hard-coding the ANSI escape
sequences.