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

Questionable tip on replacing "$(dirname …)" #18

Closed
jhermann opened this issue Oct 28, 2013 · 2 comments
Closed

Questionable tip on replacing "$(dirname …)" #18

jhermann opened this issue Oct 28, 2013 · 2 comments

Comments

@jhermann
Copy link

This is questionable, since it ignores the very real cornercase of "$0" being a plain word ("dirname foo" is ".", not "foo").

scriptdir="$(cd "$(dirname "$0")" && pwd)"
                   ^-- Use parameter expansion instead, such as ${var%/*}.
@koalaman
Copy link
Owner

koalaman commented Nov 3, 2013

Since these warnings fail for cases like "/", "", and "foo", they've been removed in 3a9ae0e

@koalaman koalaman closed this as completed Nov 3, 2013
@pihentagy
Copy link

See also issue #9

@dengyufei123 dengyufei123 mentioned this issue May 19, 2023
4 tasks
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

3 participants