bug-bash
[Top][All Lists]
Advanced

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

Filename Expansion bug


From: Mickael KENIKSSI
Subject: Filename Expansion bug
Date: Wed, 8 Jan 2020 08:34:02 +0100

Hello,

I found a bug regarding how pathnames are processed during filename
expansion. The result for non-normalized path-patterns may get mangled in a
such a way that it becomes inconsistent and unpredictable, making it
useless for string comparison or any kind of string manipulation where
having it in the exact same form as the pattern is required.

How to reproduce :

$ mkdir -p a/b/c d/e/f g/h/e; printf '%s\n' .////*//*///////*
> .////a/b/c
> .////d/e/f
> .////g/h/e
>

This is correct from a filesystem perspective but not from a string
perspective, where you'd need each of the computed path as-is:

.////a//b///////c
> .////d//e///////f
> .////g//h///////i
>

This occurs on all versions >= Bash 3.2.

Best regards,
Mickaƫl


reply via email to

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