[Bug 1919185] [NEW] Bash completion breaks the content of $_ variable
libcha
1919185 at bugs.launchpad.net
Mon Mar 15 17:57:25 UTC 2021
Public bug reported:
In bash, the $_ variable ought to contain the last parameter of previous
command. For example:
$ touch aaa bbb
$ cat aaa
$ cat bbb $_
the last line is equivalent to "cat bbb aaa".
However, if I use bash completion to fill some other parameter like
this:
$ cat bb<TAB> $_
(where <TAB> denotes hitting the TAB key), the value of the $_ variable
is overwritten with some mess, so that the result is: "cat: _filedir: No
such file or directory"
I expect this variable not to be overwritten and still contain the value
"aaa", co that the command prints out the files bbb and aaa.
This bug seems to be version-wide and usage-wide. I encounter this for
many Ubuntu releases, for example, using Kubuntu 20.10. It can be
reproduced even in terminal with no Xorg running. The resulting error
message differs according to what is being TAB-completed, for example
with git command it says: "error: pathspec '__git_main' did not match
any file(s) known to git".
** Affects: bash (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bash in Ubuntu.
https://bugs.launchpad.net/bugs/1919185
Title:
Bash completion breaks the content of $_ variable
Status in bash package in Ubuntu:
New
Bug description:
In bash, the $_ variable ought to contain the last parameter of
previous command. For example:
$ touch aaa bbb
$ cat aaa
$ cat bbb $_
the last line is equivalent to "cat bbb aaa".
However, if I use bash completion to fill some other parameter like
this:
$ cat bb<TAB> $_
(where <TAB> denotes hitting the TAB key), the value of the $_
variable is overwritten with some mess, so that the result is: "cat:
_filedir: No such file or directory"
I expect this variable not to be overwritten and still contain the
value "aaa", co that the command prints out the files bbb and aaa.
This bug seems to be version-wide and usage-wide. I encounter this for
many Ubuntu releases, for example, using Kubuntu 20.10. It can be
reproduced even in terminal with no Xorg running. The resulting error
message differs according to what is being TAB-completed, for example
with git command it says: "error: pathspec '__git_main' did not match
any file(s) known to git".
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1919185/+subscriptions
More information about the foundations-bugs
mailing list