The glob function has the GLOB_MARK flag, which is specified to add a slash to the results, which are directories:
GLOB_MARK
Each path name, which is a directory matching the pattern, must contain <slash> .
(Source: http://pubs.opengroup.org/onlinepubs/9699919799/functions/glob.html )
However, as far as I can tell, further details on how this function should work are not given. In particular, if the result is not the directory itself, but a symbolic link to the directory, should you add a slash? The glibc implementation does this.
I know this is a difficult question to answer, given the complexity of the standard for glob , so good answers would be those that refer to historical practice, historical standards or documentation other than POSIX, which can further define the behavior of glob , etc. Answers that cause reasons why one behavior or another is more useful would also be interesting.
source share