bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: read unexpected reads directory list


From: Filimonov Vadim
Subject: Re: read unexpected reads directory list
Date: Tue, 31 Mar 2015 19:26:25 +0300

 
 Hello.
You are right.
Thank You!
31.03.2015, 19:11, "Eduardo A. Bustamante López" <address@hidden>:

Not a bug.


On Tue, Mar 31, 2015 at 06:04:53PM +0300, Filimonov Vadim wrote:
[..]

address@hidden:~/bashbug/bash-4.3$ read -u63 LINE <(echo "*");echo $LINE
 bash: read: `/dev/fd/63': not a valid identifier
 ABOUT-NLS aclocal.m4 alias.c alias.h alias.o array.c arrayfunc.c arrayfunc.h arrayfunc.o array.h array.o assoc.c assoc.h assoc.o AUTHORS bash bashansi.h bashbug bashhist.c bashhist.h bashhist.o bashintl.h bashjmp

You are storing a literal asterisk in the LINE variable, and then, you're
expanding it without double quotes. One of the known side-effects of expanding
a parameter without guarding it with double quotes is that pathname expansion
occurs. Please, double quote "$LINE".

Example:

address@hidden:/$ v='*'; echo quoted: "$v"; echo unquoted: $v
quoted: *
unquoted: bin boot dev etc home initrd.img lib lib64 media mnt opt proc root run sbin srv sys tmp usr var vmlinuz

--
Eduardo Bustamante | https://dualbus.me/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]