dylanaraps / pure-sh-bible

📖 A collection of pure POSIX sh alternatives to external processes.
MIT License
6.45k stars 281 forks source link

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

Open matu3ba opened 1 year ago

matu3ba commented 1 year ago
# 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