Date: Sun, 04 Dec 2022 22:29:37 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 268156] /bin/sh: errors are printed with wrong line numbers in strict mode (set -euo pipefail) Message-ID: <bug-268156-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D268156 Bug ID: 268156 Summary: /bin/sh: errors are printed with wrong line numbers in strict mode (set -euo pipefail) Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: yuri@freebsd.org This script: > #!/bin/sh >=20 > set -euo pipefail # strict mode >=20 > echo "$1" fails with: > ./x.sh: 1: parameter not set The actual error is in line 5, not line 1. As a comparison, bash prints a correct line number: > ./x.sh: line 5: $1: unbound variable Bash error message is also more relevant. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-268156-227>