Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glob --exists absolute path (without wildcard) ? #728

Open
indexofrefraction opened this issue May 5, 2024 · 0 comments
Open

glob --exists absolute path (without wildcard) ? #728

indexofrefraction opened this issue May 5, 2024 · 0 comments

Comments

@indexofrefraction
Copy link

indexofrefraction commented May 5, 2024

hi,
i noticed that if you want to check for the existance of a file or directory
it is needed to include a pattern in glob, otherwise you don't get the correct return value.

eg.
glob --exists -d my_directory
does NOT work, it returns 0 in any case

glob --exists -d my_dir*ctory
works, but is unsafe in some situations

if you have hardcoded paths (no variables) then this is a safe workaround
glob --exists -d my_dir[e]ctory

but is there a way to check for an absolute path?
(without using wildcards)

@indexofrefraction indexofrefraction changed the title glob for fixed path glob absolute path (without wildcard) ? May 5, 2024
@indexofrefraction indexofrefraction changed the title glob absolute path (without wildcard) ? glob --exists absolute path (without wildcard) ? May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant