Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

non-matching glob can create error: posix workaround missing #46

Open
matu3ba opened this issue Sep 28, 2022 · 0 comments
Open

non-matching glob can create error: posix workaround missing #46

matu3ba opened this issue Sep 28, 2022 · 0 comments

Comments

@matu3ba
Copy link

matu3ba commented Sep 28, 2022

# somepath/* evaluates to a literal string if somepath does not exist, which can create an accidental error.
# bash offer nullglob as hacky workaround, but posix shell needs to ensure the path exists

# string/* is used verbatim without match and we dont have nullglob against that
# workaround with (extra case for symlinks)
# [ -e "$file" ] || [ -L "$file" ] || continue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant