[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LINENO is affected by sync
From: |
Greg Wooledge |
Subject: |
Re: LINENO is affected by sync |
Date: |
Wed, 1 Sep 2021 11:01:12 -0400 |
On Wed, Sep 01, 2021 at 10:36:21AM +0100, David Collier wrote:
> Version:
>
> GNU bash, version 5.0.3(1)-release (arm-unknown-linux-gnueabihf)
>
> Raspberry Pi using Raspbian.
>
> Installed from repo?
>
> LINENO goes backwards when run sync
>
> echo "================== At this point \$LINENO has correctly counted about
> 2800 lines=========================test @ 2832 $LINENO"
> echo "=== Running 'sync' makes bash lose a few counts from \$LINENO - in
> this case about ten - no idea how to fix it. ==="
> sync
> echo
> "========================================================================================test
> @ 2835 $LINENO"
There is no plausible reason an external command (sync or any other
external command) would be able to change the value of LINENO, which is
an internal shell variable.
Can you post a brief but complete script which demonstrates the problem?
I suspect whatever issue you're seeing is caused by something else, not
by the "sync" command.