[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Missing documentation "-bash_input"
From: |
Greg Wooledge |
Subject: |
Re: Missing documentation "-bash_input" |
Date: |
Tue, 28 Nov 2023 17:55:54 -0500 |
On Tue, Nov 28, 2023 at 10:33:20PM +0000, Klaus Frank wrote:
> sorry, but this is not true, I can clearly see that it exists. It may be an
> distro addition though. Is it specific to ArchLinux?
Here's what I get on Debian:
unicorn:~$ bash -bash_input foobar -c 'read; declare -p REPLY'
bash: -_: invalid option
Usage: bash [GNU long option] [option] ...
bash [GNU long option] [option] script-file ...
GNU long options:
--debug
--debugger
[...]
I get the same thing if I use a bash that I compiled from upstream source.
If I try --bash_input I get this:
unicorn:~$ bash --bash_input foobar -c 'read; declare -p REPLY'
bash: --bash_input: invalid option
Usage: bash [GNU long option] [option] ...
bash [GNU long option] [option] script-file ...
GNU long options:
--debug
--debugger
[...]
> Bash source code on GitHub mirror:
> https://github.com/bminor/bash/blob/master/y.tab.c#L3967
>
> "(--bash_input.location.string) = c;"
That's the pre-decrement operator in C. Here's the full context for
that snippet:
static int
yy_string_unget (c)
int c;
{
*(--bash_input.location.string) = c;
return (c);
}
It's decreasing the value of bash_input by 1, before accessing it.
It has nothing to do with the presence or absence of "--bash_input" or
"-bash_input" as a command line argument.