bug-bash
[Top][All Lists]
Advanced

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

LINENO does sometimes not correspond to real line number


From: werner
Subject: LINENO does sometimes not correspond to real line number
Date: Wed, 3 Apr 2019 10:40:06 +0200

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -fmessage-length=0 -grecord-gcc-switches -O2 -Wall 
-D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables 
-fasynchronous-unwind-tables -fstack-clash-protection -g  -D_GNU_SOURCE 
-DRECYCLES_PIDS -Wall -g -Wuninitialized -Wextra -Wno-switch-enum 
-Wno-unused-variable -Wno-unused-parameter -Wno-parentheses -ftree-loop-linear 
-pipe -DBNC382214=0 -DIMPORT_FUNCTIONS_DEF=0 -Wno-parentheses 
-Wno-format-security
uname output: Linux boole 4.12.14-lp150.12.48-default #1 SMP Tue Feb 12 
14:01:48 UTC 2019 (268f014) x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-suse-linux-gnu

Bash Version: 5.0
Patch Level: 3
Release Status: release

Description:
        I've reports from users that some of their scripts do not show
        the correct line number if $LINENO is echoed

Repeat-By:
        The script

        -----------------------------------------------------
        #!/bin/bash -x

        echo "003: $LINENO"
        echo x && {
            (PATH=/bin; sh -c :)
        }
        echo "007: $LINENO"
        -----------------------------------------------------

        shows:

        tmp/bug.sh
        + echo '003: 3'
        003: 3
        + echo x
        x
        + PATH=/bin
        + sh -c :
        + echo '007: 6'
        007: 6



reply via email to

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