bug-bash
[Top][All Lists]
Advanced

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

bash 5: globstar (sometimes) no longer prints symlinks to directories


From: Eli Schwartz
Subject: bash 5: globstar (sometimes) no longer prints symlinks to directories
Date: Mon, 8 Apr 2019 12:57:52 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3

wwww. The `globstar' code now skips over symbolic links to directories,
      preventing them from being scanned twice.

What is the purpose of this change? In bash 4.4, if I wanted to print
all the entries in a directory tree, whether it is a file, directory, or
symbolic link, I could use shopt -s globstar && printf %s\\n **

Now, I get different results depending on whether the printed result is
an unbroken symlink to a directory object. I cannot even print the
symlink if it points to an existing directory outside of the directory
tree I'm printing. I'm not sure what this was supposed to fix, though,
because bash 4.4 didn't recurse into the directory either way.

Why this matters: I have an application that used globstar to list files
which should be added to a tarball with bsdtar, using a given sort order:

https://git.archlinux.org/pacman.git/commit/?id=b5191ea140386dd9b73e4509ffa9a6d347c1b5fa

This change used to work, and now it doesn't.

...

#bash pointed out to me that **/* will do what I want on both bash 4 and
bash 5, but I'm afraid I totally don't understand what the rules of
globstar are supposed to be, or whether changes to the output are
intended. The behavior also doesn't really seem to correspond to the
manpage.

-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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