On Fri, 26 Aug 2022, Tim Woodall wrote:
$ cat Makefile.test
...
Many thanks everybody for all of the help understanding this.
Not this exact issue but effectively the same was reported in bug
#944780 and the unbound variable in /etc/bash.bashrc was reported in
#941248
I've now submitted a
On Sun, 28 Aug 2022 at 01:30, Greg Wooledge wrote:
> On Sun, Aug 28, 2022 at 12:46:17AM +1000, David wrote:
> > I think there might be one remaining aspect still mysterious, so there
> > might be yet another factor beyond the FIVE you identified ...
> >
> > The fact that this statement, first sho
On Sun, Aug 28, 2022 at 12:46:17AM +1000, David wrote:
> I think there might be one remaining aspect still mysterious, so there
> might be yet another factor beyond the FIVE you identified ...
>
> The fact that this statement, first shown by Tim, does NOT error:
>
> $ ( bash -uc : ; : )
(insid
On Sun, 28 Aug 2022 at 00:17, Greg Wooledge wrote:
> On Sat, Aug 27, 2022 at 09:52:11AM -0400, Greg Wooledge wrote:
> > I also can't explain this (still inside the ssh localhost session):
> >
> > unicorn:~$ (bash -c 'declare -p PS1')
> > declare -- PS1="\\h:\\w\\\$ "
> > unicorn:~$ (bash -cu 'dec
On Sat, Aug 27, 2022 at 09:52:11AM -0400, Greg Wooledge wrote:
> I also can't explain this (still inside the ssh localhost session):
>
>
> unicorn:~$ (bash -c 'declare -p PS1')
> declare -- PS1="\\h:\\w\\\$ "
> unicorn:~$ (bash -cu 'declare -p PS1')
> /etc/bash.bashrc: line 7: PS1: unbound variab
On Sat, Aug 27, 2022 at 05:12:57PM +1000, David wrote:
> I have modified my ssh environment so that it is not the default.
> But I do see a similar error message, using ssh from stable Debian 11.
>
> [david@kablamm ~]$ ( bash -cu : )
> [david@kablamm ~]$ ssh kablamm
> Linux kablamm 5.10.0-16-amd64
On Sat, Aug 27, 2022 at 12:11:47AM -0500, David Wright wrote:
> On Sat 27 Aug 2022 at 00:23:10 (-0400), gene heskett wrote:
> > On 8/26/22 20:35, David wrote:
> > > On Sat, 27 Aug 2022 at 10:27, Greg Wooledge wrote:
> > > > I get these results as well, with Debian 11's packaged bash.
> > > Yeah, s
On Sat, 27 Aug 2022 at 16:49, Tim Woodall wrote:
> This just gets weirder and weirder.
>
> It looks like it's related to logging in with ssh:
[..]
> apt-mirror@aptmirror17:~$ ( bash -cu : )
> apt-mirror@aptmirror17:~$
> apt-mirror@aptmirror17:~$ ssh aptmirror17
> Last login: Sat Aug 27 06:23:1
On Sat, Aug 27, 2022 at 07:49:17AM +0100, Tim Woodall wrote:
> On Sat, 27 Aug 2022, to...@tuxteam.de wrote:
>
> > On Sat, Aug 27, 2022 at 11:22:09AM +1000, David wrote:
> > > On Sat, 27 Aug 2022 at 10:27, Greg Wooledge wrote:
> > >
> > > > Has anyone managed to reproduce the OP's results, either
On Sat, 27 Aug 2022, to...@tuxteam.de wrote:
On Sat, Aug 27, 2022 at 11:22:09AM +1000, David wrote:
On Sat, 27 Aug 2022 at 10:27, Greg Wooledge wrote:
Has anyone managed to reproduce the OP's results, either getting
"interactive" from a bash -c call, or seeing *any* evidence that
/etc/bash.b
On Sat, 27 Aug 2022 at 15:07, wrote:
> On Sat, Aug 27, 2022 at 11:22:09AM +1000, David wrote:
> > On Sat, 27 Aug 2022 at 10:27, Greg Wooledge wrote:
> > > Has anyone managed to reproduce the OP's results, either getting
> > > "interactive" from a bash -c call, or seeing *any* evidence that
> > >
On Sat 27 Aug 2022 at 00:23:10 (-0400), gene heskett wrote:
> On 8/26/22 20:35, David wrote:
> > On Sat, 27 Aug 2022 at 10:27, Greg Wooledge wrote:
> > > I get these results as well, with Debian 11's packaged bash.
> > Yeah, sorry, I forgot to include, for the record:
> >
> > $ echo $BASH_VERSION
On Sat, Aug 27, 2022 at 11:22:09AM +1000, David wrote:
> On Sat, 27 Aug 2022 at 10:27, Greg Wooledge wrote:
>
> > Has anyone managed to reproduce the OP's results, either getting
> > "interactive" from a bash -c call, or seeing *any* evidence that
> > /etc/bash.bashrc or ~/.bashrc is sourced from
On Sat, Aug 27, 2022 at 10:32:06AM +1000, David wrote:
> On Sat, 27 Aug 2022 at 10:27, Greg Wooledge wrote:
> > On Sat, Aug 27, 2022 at 10:21:08AM +1000, David wrote:
>
> > > Just sharing something that I tried, to shed some more light
> > > on this, in case that's useful ...
> > >
> > > $ foo()
On 8/26/22 20:35, David wrote:
On Sat, 27 Aug 2022 at 10:27, Greg Wooledge wrote:
On Sat, Aug 27, 2022 at 10:21:08AM +1000, David wrote:
Just sharing something that I tried, to shed some more light
on this, in case that's useful ...
$ foo() { case "$-" in *i* ) i=interactive ;; * ) i=not-inte
On Sat, 27 Aug 2022 at 10:27, Greg Wooledge wrote:
> Has anyone managed to reproduce the OP's results, either getting
> "interactive" from a bash -c call, or seeing *any* evidence that
> /etc/bash.bashrc or ~/.bashrc is sourced from a bash -c call?
On Debian 11, when I create a test user, login
On Sat, 27 Aug 2022 at 10:27, Greg Wooledge wrote:
> On Sat, Aug 27, 2022 at 10:21:08AM +1000, David wrote:
> > Just sharing something that I tried, to shed some more light
> > on this, in case that's useful ...
> >
> > $ foo() { case "$-" in *i* ) i=interactive ;; * ) i=not-interactive ;;
> > es
On Sat, Aug 27, 2022 at 10:21:08AM +1000, David wrote:
> Just sharing something that I tried, to shed some more light
> on this, in case that's useful ...
>
> $ foo() { case "$-" in *i* ) i=interactive ;; * ) i=not-interactive ;;
> esac ; echo $BASHPID $i ; }
> $ declare -fx foo
> $ foo
> 2415 int
On Sat, 27 Aug 2022 at 08:54, Tim Woodall wrote:
> On Fri, 26 Aug 2022, to...@tuxteam.de wrote:
> > On Fri, Aug 26, 2022 at 10:57:44AM -0400, Greg Wooledge wrote:
> I modified /etc/bash.bashrc to prove it was only being sourced in the
> second case above (it prints the value of PS1)
>
> And now I
On Fri, Aug 26, 2022 at 11:54:06PM +0100, Tim Woodall wrote:
> I modified /etc/bash.bashrc to prove it was only being sourced in the
> second case above (it prints the value of PS1)
>
> And now I can reproduce without -u
> $ bash -c :
> $ ( bash -c : )
> 'PS1='
> $ ( bash -c : ; : )
> $
I can't r
On Fri, 26 Aug 2022, to...@tuxteam.de wrote:
On Fri, Aug 26, 2022 at 10:57:44AM -0400, Greg Wooledge wrote:
[...]
There are also various hacks that are compiled into Debian's version
of bash [...]
At this moment, I'm kind of leaning toward one of those hacks being
triggered by your specifi
On Fri, Aug 26, 2022 at 10:57:44AM -0400, Greg Wooledge wrote:
[...]
> There are also various hacks that are compiled into Debian's version
> of bash [...]
> At this moment, I'm kind of leaning toward one of those hacks being
> triggered by your specific combination of factors.
That's the most
On Fri, Aug 26, 2022 at 02:51:47PM +0100, Tim Woodall wrote:
> The real Makefile has -euo pipefail
I have stopped reading and caring now. Good luck.
On Fri, Aug 26, 2022 at 02:40:55PM +0100, Tim Woodall wrote:
> But that's backwards, make is starting an interactive shell when its
> output is redirected. When I don't redirect make's output it works.
I thought you were piping in the original message. There is a difference
between a pipe, and a
On Fri, 26 Aug 2022 at 23:41, Tim Woodall wrote:
> On Fri, 26 Aug 2022, David wrote:
> > On Fri, 26 Aug 2022 at 22:14, wrote:
> >> And then, there's that other riddle: why is a shell invoked from a
> >> Makefile sourcing /etc/bash.bashrc in the first place?
> >
> > Hi, my understanding is that t
On Fri, 26 Aug 2022, David wrote:
On Fri, 26 Aug 2022 at 22:14, wrote:
On Fri, Aug 26, 2022 at 07:24:44AM -0400, Greg Wooledge wrote:
On Fri, Aug 26, 2022 at 08:17:10AM +0100, Tim Woodall wrote:
[...]
On Fri, Aug 26, 2022 at 11:04:25AM +0200, Thomas Schmitt wrote:
to...@tuxteam.de wrote:
On Fri, 26 Aug 2022, David wrote:
On Fri, 26 Aug 2022 at 22:14, wrote:
And then, there's that other riddle: why is a shell invoked from a
Makefile sourcing /etc/bash.bashrc in the first place?
Hi, my understanding is that the rule commands in the Makefile are run by
a shell, one for each li
On Fri, 26 Aug 2022 at 22:14, wrote:
> On Fri, Aug 26, 2022 at 07:24:44AM -0400, Greg Wooledge wrote:
> > On Fri, Aug 26, 2022 at 08:17:10AM +0100, Tim Woodall wrote:
[...]
> > On Fri, Aug 26, 2022 at 11:04:25AM +0200, Thomas Schmitt wrote:
> > > to...@tuxteam.de wrote:
> But all in all we're s
On Fri, 26 Aug 2022 at 22:14, wrote:
> And then, there's that other riddle: why is a shell invoked from a
> Makefile sourcing /etc/bash.bashrc in the first place?
Hi, my understanding is that the rule commands in the Makefile are run by
a shell, one for each line. The output stream of those comm
On Fri, Aug 26, 2022 at 07:24:44AM -0400, Greg Wooledge wrote:
> On Fri, Aug 26, 2022 at 08:17:10AM +0100, Tim Woodall wrote:
> > $ cat Makefile.test
> > SHELL := /bin/bash -u
>
> WHY?!
>
> > Why do I get that unbound variable error?
>
> Because you turned on set -u in a place where the code had
On Fri, Aug 26, 2022 at 11:14:37AM +0100, Tim Woodall wrote:
> $ bash -uic 'echo done'
> bash: SUDO_USER: unbound variable
> bash: color_prompt: unbound variable
> done
> $
Cute. Mine's even weirder:
unicorn:~$ bash -uic 'echo done'
bash: SUDO_USER: unbound variable
bash: no: unbound variable
do
On Fri, Aug 26, 2022 at 08:17:10AM +0100, Tim Woodall wrote:
> $ cat Makefile.test
> SHELL := /bin/bash -u
WHY?!
> Why do I get that unbound variable error?
Because you turned on set -u in a place where the code had not been
adjusted to account for set -u's foibles.
set -u breaks scripts. It's
On Fri, Aug 26, 2022 at 09:19:03AM +0100, Tim Woodall wrote:
[...]
Yes, I know how to fix it. That is straight forward. SUDO_USER and
SUDO_PS1 have similar issues, debian_chroot works in the presence of set
-u
I see.
But I don't understand why /etc/bash.bashrc is being sourced by make
w
On Fri, 26 Aug 2022 at 18:02, wrote:
> On Fri, Aug 26, 2022 at 08:17:10AM +0100, Tim Woodall wrote:
> > $ cat Makefile.test
> > SHELL := /bin/bash -u
> > MAKEFLAGS += --no-builtin-rules
> > .SUFFIXES:
> >
> > all:
> > echo done
> > $ make -f Makefile.test
> > echo done
> > done
> > $ make
On Fri, Aug 26, 2022 at 11:04:25AM +0200, Thomas Schmitt wrote:
> Hi,
>
> to...@tuxteam.de wrote:
> > Why {PS1:+x} rather than {PS1:-}?
>
> It seemed to be the nearest suitable variation which was similar to the
> proposal
> [ ${var+x} ]
[...]
Thanks :)
Cheers
--
t
signature.asc
Descripti
Hi,
to...@tuxteam.de wrote:
> Why {PS1:+x} rather than {PS1:-}?
It seemed to be the nearest suitable variation which was similar to the
proposal
[ ${var+x} ]
in
https://stackoverflow.com/questions/3601515/how-to-check-if-a-variable-is-set-in-bash
where one can see a nice table of ${VARIABLE.
On Fri, Aug 26, 2022 at 09:19:03AM +0100, Tim Woodall wrote:
[...]
> Yes, I know how to fix it. That is straight forward. SUDO_USER and
> SUDO_PS1 have similar issues, debian_chroot works in the presence of set
> -u
I see.
> But I don't understand why /etc/bash.bashrc is being sourced by make
>
On Fri, 26 Aug 2022, to...@tuxteam.de wrote:
On Fri, Aug 26, 2022 at 08:17:10AM +0100, Tim Woodall wrote:
$ cat Makefile.test
SHELL := /bin/bash -u
MAKEFLAGS += --no-builtin-rules
.SUFFIXES:
all:
echo done
$ make -f Makefile.test
echo done
done
$ make -f Makefile.test | cat
echo done
/
On Fri, Aug 26, 2022 at 10:01:06AM +0200, Thomas Schmitt wrote:
> Hi,
>
> > $ cat Makefile.test
> > SHELL := /bin/bash -u
> > [...]
> > /etc/bash.bashrc: line 7: PS1: unbound variable
> > [...]
> > Why do I get that unbound variable error?
>
> According to a comment in /etc/bash.bashrc it tests f
On Fri, Aug 26, 2022 at 08:17:10AM +0100, Tim Woodall wrote:
> $ cat Makefile.test
> SHELL := /bin/bash -u
> MAKEFLAGS += --no-builtin-rules
> .SUFFIXES:
>
> all:
> echo done
> $ make -f Makefile.test
> echo done
> done
> $ make -f Makefile.test | cat
> echo done
> /etc/bash.bashrc: line 7
Hi,
> $ cat Makefile.test
> SHELL := /bin/bash -u
> [...]
> /etc/bash.bashrc: line 7: PS1: unbound variable
> [...]
> Why do I get that unbound variable error?
According to a comment in /etc/bash.bashrc it tests for emptiness of PS1
in order to detect non-interactive shell sessions:
# If not r
41 matches
Mail list logo