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: Eduardo A . Bustamante López
Subject: Re: read unexpected reads directory list
Date: Tue, 31 Mar 2015 10:11:45 -0600
User-agent: Mutt/1.5.23 (2014-03-12)

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]