bug-bash
[Top][All Lists]
Advanced

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

Re: It is possible that this can be a bug


From: Dennis Williamson
Subject: Re: It is possible that this can be a bug
Date: Mon, 26 Jun 2023 15:20:22 -0500

On Mon, Jun 26, 2023, 2:47 PM Hugo Napoli <hugonapoli@gmail.com> wrote:

> Dear Dennis and Martin, thank you very much for the quick response.
>
> From now on, I'll use *exec bash "$0" *instead of *bash "$0"*.
> What I'm wondering is (now that I understand why this happened) if there
> is some special situation where it's actually worth using *bash "$0"*. If
> you have any ideas, I will really appreciate it if you can share them with
> me.
>
> As for using *a=$((b+c))*, I'll also start using *((a=b+c))* whenever
> possible, leaving out the "$", as suggested.
>
> Thank you very much, also, for the examples you have shown me. I have
> learned BASH mostly self-taught. I think this is why I have been making
> these mistakes.
>
>
> *Hugo Napoli *
>
>>
>>
>>
I would suggest that you use a loop as shown in Greg's message. I answered
showing exec since it followed the structure of your original script. It's
very unusual to use that technique in a script such as yours. I apologize
for not providing better guidance.

Also using $0 only works in certain circumstances and shouldn't be relied
on in all cases. https://mywiki.wooledge.org/BashFAQ/028

>


reply via email to

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