Re: echo builtin command will give the wrong value of the variable when there is a file named: 11 in the current directory

2016-07-27 Thread Lingfei Kong
Hi Greg, Thank you for your detailed explanation, I now understand the reason, and will use quote in my scripts to avoid unexpected bugs. Best Regards Lingfei Kong -- Original -- From: "Greg Wooledge";; Date: Wed, Jul 27, 2016 09:28 PM To: "Lingfei Kong"<46

Re: bug in [ -f file ] test

2016-07-27 Thread Chet Ramey
On 7/27/16 3:34 PM, László Házy wrote: > You have probably not done the first command: "[user1]$ chmod g+rx > /home/user1". In my case, there is no access problem. I can ls and cd. > Thing is, even root gets the wrong answer if it does the "is file?" query. I performed that command, but I tore it

Re: bug in [ -f file ] test

2016-07-27 Thread Greg Wooledge
On Wed, Jul 27, 2016 at 03:34:19PM -0400, László Házy wrote: > You have probably not done the first command: "[user1]$ chmod g+rx > /home/user1". In my case, there is no access problem. I can ls and cd. > Thing is, even root gets the wrong answer if it does the "is file?" > query. You're misunders

Re: [patch] typo in readline 7.0 beta2 release

2016-07-27 Thread Chet Ramey
On 7/25/16 2:56 PM, Matthias Klose wrote: > small typo building the docs. Thanks for the report and fix. > also we had release candidates before, now reverting to beta names. is this > expected? Yes, since readline and bash track the same release cycle. -- ``The lyf so short, the craft so long

Re: bug in [ -f file ] test

2016-07-27 Thread Chet Ramey
On 7/26/16 5:07 PM, László Házy wrote: > Hmm, interesting. I can reproduce your results. Thanks. > However, note the following: > > [user1]$ chmod g+rx /home/user1 > [user1]$ touch file; ls -l file > -rw-r--r--. 1 user1 users0 Jul 26 15:24 file > > [user1]$ su user2 -c "ln -s /home/user1/file

Re: a=$* -> crash

2016-07-27 Thread Chet Ramey
On 7/27/16 7:59 AM, Andreas Schwab wrote: > (gdb) r > Starting program: /bin/bash -c a=\$\* > > Program received signal SIGSEGV, Segmentation fault. > quote_string (string=string@entry=0x0) at subst.c:3940 > 3940 if (*string == 0) Thanks for the report and fix. Chet -- ``The lyf so short,

Re: ''"$@" expansion

2016-07-27 Thread Chet Ramey
On 5/12/16 7:37 PM, Grisha Levit wrote: > Thanks for the pointer. Looking at that interpretation > (http://austingroupbugs.net/view.php?id=888), I noticed that it includes > one case that bash is not handling correctly: > > If there are no positional parameters, the expansion of |@| shall >

Re: bug in [ -f file ] test

2016-07-27 Thread Reuti
> Am 27.07.2016 um 18:55 schrieb László Házy : > > Here it goes. Note that the second command you asked for returns the same as > the "file" entry in the first command. Thanks. Yeah, I meant: $ ls -Zd /home/user1 to show the entry of the directory itself, not its content. - Reuti > [user1]$

Re: bug in [ -f file ] test

2016-07-27 Thread László Házy
Here it goes. Note that the second command you asked for returns the same as the "file" entry in the first command. Thanks. [user1]$ ls -Z /home/user1 unconfined_u:object_r:user_home_t:s0 Desktop unconfined_u:object_r:user_home_t:s0 Documents unconfined_u:object_r:user_home_t:s0 Downloads uncon

Re: bug in [ -f file ] test

2016-07-27 Thread Reuti
> Am 27.07.2016 um 18:13 schrieb László Házy : > > Yes, SELinux is active. Fine. Can you please provide: $ ls -Z /home/user1 $ ls -Z /home/user1/file -- Reuti > On Wed, 2016-07-27 at 17:55 +0200, Reuti wrote: >>> >>> Am 27.07.2016 um 17:36 schrieb László Házy < >>> haz...@yahoo.com >>> >:

Re: bug in [ -f file ] test

2016-07-27 Thread Reuti
> Am 27.07.2016 um 17:36 schrieb László Házy : > > Yes, user2 has rx access to /home/user1. This is done by the first command in > the list of commands, namely: "[user1]$ chmod g+rx /home/user1". The two > users are part of the same group. > > An even more troublesome variation, involving root

Re: bug in [ -f file ] test

2016-07-27 Thread László Házy
Yes, user2 has rx access to /home/user1. This is done by the first command in the list of commands, namely: "[user1]$ chmod g+rx /home/user1". The two users are part of the same group. An even more troublesome variation, involving root, is the following: [user1]$ touch file; ls -l file -rw-r--r--.

Re: echo builtin command will give the wrong value of the variable when there is a file named: 11 in the current directory

2016-07-27 Thread Greg Wooledge
On Wed, Jul 27, 2016 at 07:24:11PM +0800, Lingfei Kong wrote: > # touch 11 > # c='[11761][1469504252]' > # echo $c > 11 This is why you MUST ALWAYS quote your parameter expansions. echo "$c" http://mywiki.wooledge.org/Quotes http://mywiki.wooledge.org/BashGuide

Re: echo builtin command will give the wrong value of the variable when there is a file named: 11 in the current directory

2016-07-27 Thread Pierre Gaston
On Wed, Jul 27, 2016 at 2:28 PM, Lingfei Kong <466701...@qq.com> wrote: > Another reproducer: > > # c='[1][1][1]' > # touch 111 > # echo $c > 111 > # rm 111 > # echo $c > [1][1][1] > > -- Original -- > *From: * "Lingfei Kong";<466701...@qq.com>; > *Date: * Wed, Jul

Re: echo builtin command will give the wrong value of the variable when there is a file named: 11 in the current directory

2016-07-27 Thread Lingfei Kong
Another reproducer: # c='[1][1][1]' # touch 111 # echo $c 111 # rm 111 # echo $c [1][1][1] -- Original -- From: "Lingfei Kong";<466701...@qq.com>; Date: Wed, Jul 27, 2016 07:24 PM To: "bug-bash"; Subject: echo builtin command will give the wrong value of t

echo builtin command will give the wrong value of the variable when there is a file named: 11 in the current directory

2016-07-27 Thread Lingfei Kong
Description:echo builtin command will give the wrong value of the variable when there is a file named: 11 in the current directory. Version:GNU bash, version 4.2.45(1)-release-by_tst_tlinux20_v1004 (x86_64-unknown-linux-gnu)GNU bash, version 4.1.2(1)-release-by_mupan_tlinux_v1004 (x86_64-unknow

a=$* -> crash

2016-07-27 Thread Andreas Schwab
(gdb) r Starting program: /bin/bash -c a=\$\* Program received signal SIGSEGV, Segmentation fault. quote_string (string=string@entry=0x0) at subst.c:3940 3940 if (*string == 0) diff --git a/subst.c b/subst.c index 37d96f9..16ae3f0 100644 --- a/subst.c +++ b/subst.c @@ -8575,7 +8575,7 @@ para