[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug Using Brackets
From: |
Oğuz |
Subject: |
Re: Bug Using Brackets |
Date: |
Wed, 6 Jan 2021 18:09:10 +0200 |
6 Ocak 2021 Çarşamba tarihinde Harry Lee <chn.lee.yumi@gmail.com> yazdı:
> Hi,
>
> I found a bug when bash parsing brackets with version 5.0.3. Here are some
> outputs:
>
> root@server:~# bash -version
> GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu)
> Copyright (C) 2019 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.
> html>
>
> This is free software; you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> root@server:~# echo [0-1]
> 1
> root@server:~# echo [[[[[[[[[208174hkjdfsglh0-13984jf0]
> 1
>
> When I use a old version bash, it's ok:
>
> root@server2:~# bash -version
> GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)
> Copyright (C) 2016 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.
> html>
>
> This is free software; you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> root@server2:~# echo [0-1]
> [0-1]
> root@server2:~# echo [[[[[[[[[208174hkjdfsglh0-13984jf0]
> [[[[[[[[[208174hkjdfsglh0-13984jf0]
>
This is not a bug but a feature, namely, _pathname expansion_. Observe:
$ echo [1] [[[[1]
[1] [[[[1]
$
$ touch 1
$ echo [1] [[[[1]
1 1
Best regards,
> Harry Lee
--
Oğuz