bug-coreutils
[Top][All Lists]
Advanced

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

bug#22433: mkdir bug (?)


From: Eric Blake
Subject: bug#22433: mkdir bug (?)
Date: Fri, 22 Jan 2016 09:52:32 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

tag 22433 notabug
thanks

On 01/22/2016 05:52 AM, address@hidden wrote:
> The following command:
> (cd ${IMAGE_MODIFIED_ROOTFS}; mkdir -p opt/chloride/{bin,etc,var,archive};)
> 
> Created the following:
> [cid:image001.png@01D1551C.2D04F580]

Thanks for the report.  Next time, please copy and paste text into your
email, rather than attaching an image, as it not only wastes bandwidth,
but it is also harder to reply to a screenshot.

Transcription of your image:

> total 12
> drwxrwxr-x 3 user user 4096 Jan 22 13:46 .
> drwxrwxr-x 3 user user 4096 Jan 22 13:46 ..
> drwxrwxr-x 2 user user 4096 Jan 22 13:46 {bin,etc,var,archive}
> address@hidden:/tmp/ghmi/opt/chloride$

But I see no bug there - you asked for a file name with braces, and got one.

Oh, were you expecting brace expansion to happen?  Brace expansion is a
feature of some shells (such as bash), but is not required by POSIX and
is therefore not universal to all shells (such as dash).  I suspect you
normally use bash, but ran your command on a system where /bin/sh is dash.

To find out whether you are using a shell that does brace expansion, try:

echo {a,b}

If the result is "{a,b}", then you will get the same behavior for your
mkdir command.  If the result is "a b", then you will get four
directories due to brace expansion.  But remember that it is your shell,
not mkdir, that does brace expansion prior to mkdir ever seeing its
arguments.

As such, I'm closing this as not a bug, but feel free to add further
comments to this thread.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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