Error expanding variable containing a directory name

2020-07-23 Thread Lutz Adam

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2 
-fdebug-prefix-map=/build/bash-a6qmCk/bash-5.0=. 
-fstack-protector-strong -Wformat -Werror=format-
uname output: Linux fractal 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 
00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Machine Type: x86_64-pc-linux-gnu

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

Description:
   The content of $ML is "/media/lad".  There's a directory 
/media/lad/p24. Typing the command

            ls $ML/p24
   a backslash is put befor "$" and the line looks like:
            ls \$ML/p24/
   Typing the ENTER key shows:
            ls: cannot access '$ML/p24/': No such file or directory.

Repeat-By:
    Create a variable containing a directory name. Put a 
subdirectory there under.
        Type a "$" and the variable followed by a slash, the name of 
the subdirectora and the TAB-key.



The OS is Linux Mint 20



Shell does not recognize umlaut in URL

2020-07-23 Thread Lutz Adam

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2 
-fdebug-prefix-map=/build/bash-a6qmCk/bash-5.0=. 
-fstack-protector-strong -Wformat -Werror=format-
uname output: Linux fractal 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 
00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Machine Type: x86_64-pc-linux-gnu

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

Description:
   If a URL on the command line or in a file contains an umlaut as in
        https://dict.leo.org/franz*ö*sisch-deutsch
        the shell stops recognising the URL after the umlaut "ö". Only 
the part
   "https://dict.leo.org/franz*ö*"; is underlined and used in a call 
to a browser.**


Repeat-By:
    Put the above URL on the command line.
        1.   Hover over the ULR. Only the left part is underlined.
        2.   Press and hold CTRL, then left-click the URL: the URL is 
opened in a browser,

          but only the left part appears in the address field.

The OS is Linux Mint 20




Re: Shell does not recognize umlaut in URL

2020-07-23 Thread Eli Schwartz
On 7/23/20 11:56 AM, Lutz Adam wrote:
> Description:
>    If a URL on the command line or in a file contains an umlaut as in
>         https://dict.leo.org/franz*ö*sisch-deutsch
>         the shell stops recognising the URL after the umlaut "ö". Only
> the part
>    "https://dict.leo.org/franz*ö*"; is underlined and used in a call
> to a browser.**
> 
> Repeat-By:
>     Put the above URL on the command line.
>         1.   Hover over the ULR. Only the left part is underlined.
>         2.   Press and hold CTRL, then left-click the URL: the URL is
> opened in a browser,
>           but only the left part appears in the address field.
> 
> The OS is Linux Mint 20

bash doesn't underline urls or open them in browsers. This is performed
by the terminal emulator program. Please report this to the support
medium provided by your current terminal emulator.

-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


Re: Error expanding variable containing a directory name

2020-07-23 Thread Eli Schwartz
On 7/23/20 12:08 PM, Lutz Adam wrote:
> Description:
>    The content of $ML is "/media/lad".  There's a directory
> /media/lad/p24. Typing the command
>             ls $ML/p24
>    a backslash is put befor "$" and the line looks like:
>             ls \$ML/p24/
>    Typing the ENTER key shows:
>             ls: cannot access '$ML/p24/': No such file or directory.
> 
> Repeat-By:
>     Create a variable containing a directory name. Put a
> subdirectory there under.
>         Type a "$" and the variable followed by a slash, the name of the
> subdirectora and the TAB-key.
> 
> 
> The OS is Linux Mint 20

The built-in bash tab completion actually does this okay. Are you using
the bash-completion project addon functionality?

[eschwartz@arch ~]$ ls $HOME/
 --> rewrites in-place to...
[eschwartz@arch ~]$ ls \$HOME/
[eschwartz@arch ~]$ bash --norc --noprofile
bash-5.0$ ls $HOME/
Display all 163 possibilities? (y or n)
[...]


-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


Re: Error expanding variable containing a directory name

2020-07-23 Thread Lawrence Velázquez
> On Jul 23, 2020, at 12:08 PM, Lutz Adam  wrote:
> 
> Bash Version: 5.0
> Patch Level: 17
> Release Status: release
> 
> Description:
>The content of $ML is "/media/lad".  There's a directory
>/media/lad/p24. Typing the command
> ls $ML/p24
>a backslash is put befor "$" and the line looks like:
> ls \$ML/p24/
>Typing the ENTER key shows:
> ls: cannot access '$ML/p24/': No such file or directory.
> 
> Repeat-By:
> Create a variable containing a directory name. Put a
> subdirectory there under.
> Type a "$" and the variable followed by a slash, the name
> of the subdirectora and the TAB-key.

A recent identical report, plus responses:

https://lists.gnu.org/archive/html/bug-bash/2020-05/msg00040.html

vq



No word splitting for assignment-like expressions in compound assignment

2020-07-23 Thread Alexey Izbyshev

Hello!

I have a question about the following behavior:

$ Z='a b'
$ A=(X=$Z)
$ declare -p A
declare -a A=([0]="X=a b")
$ A=(X$Z)
$ declare -p A
declare -a A=([0]="Xa" [1]="b")

I find it surprising that no word splitting is performed in the first 
compound assignment. I realize that skipping word splitting may be 
desirable if a subscript is given (e.g. "A=([0]=$Z)") to make it 
consistent with normal variable assignment[1], but in this case it looks 
like a bug.


I've reproduced the described behavior on bash 4.4.20 (Ubuntu 18.04), 
3.1.17 (CentOS 5) and self-built 5.1-alpha release.


Some other discoveries:
* Brace expansion is performed for "A=(X=a{x,y}b)" by all bash versions 
mentioned above (which is inconsistent with normal variable assignment).
* Globbing for "A=(X=a?b)" is performed by bash 3.1.17, but not by other 
versions.


[1] https://lists.gnu.org/archive/html/bug-bash/2012-08/msg00055.html

Alexey



EOF not disabled in readline

2020-07-23 Thread Grisha Levit
It seems that disabling the EOF character does not have an effect on
readline. For example:

$ stty sane
$ stty eof undef
$ ^D
Use "logout" to leave the shell.
$ read -e; echo $?
^D
1

But the setting did take effect, as can be verified by running, e.g.
`read' w/o readline:

$ read -n1; echo ${REPLY@Q}
^D$'\004'

Setting the EOF character to anything else works as expected but, when
followed by an `stty eof undef', readline keeps using whatever the value
that had previously been set.

My goal was to bind a custom function to ^D and, as a workaround, setting
EOF to some nearly-impossible to type character works fine but I'm not
sure if the inability to disable EOF is expected.



$SHELLOPTS after function with `local -'

2020-07-23 Thread Grisha Levit
The value of $SHELLOPTS is not always updated correctly after returning
from a function that modifies options after using `local -'.

For example:

fun() { local -; set -u; }; fun
[[ $- == *u* ]]; echo $?# 1
[[ :$SHELLOPTS: == *:nounset:* ]]; echo $?  # 0

This seems to be the case for the following set of options:
interactive-comments, keyword, monitor, noclobber, noglob, nolog, notify,
nounset, onecmd, physical, pipefail, privileged, verbose, xtrace

While it works correctly for:
allexport, braceexpand, emacs, errexit, errtrace, functrace, hashall,
histexpand, history, ignoreeof, noexec, posix, vi



$IGNOREEOF always modified by `local -'

2020-07-23 Thread Grisha Levit
Having IGNOREEOF defined prior to invoking a function that uses `local -'
causes IGNOREEOF to be set to `10' after the function returns.

$ IGNOREEOF=0; f() { local -; }; f; echo $IGNOREEOF
10