-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Use $PWD
instead of $(pwd)
#1927
Conversation
This draft is actually ready to review assuming that my basename PR (#1926) is accepted. Anyone feel like taking a look before the other is merged? 😃 |
$PWD
instead of $(pwd)
$PWD
instead of $(pwd)
I'm marking this ready-for-review, but do please note that it looks larger than it is since this PR is based on the same |
3cf7c47
to
e0ae8a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, after merging #1926 of course 😄
Don't subshell when there's a shell parameter for it.
Don't subshell when there's a shell parameter for it.
NOTE: This PR assumes that my
basenamed
branch has already been merged (#1926)! This PR does not do anything withbasename
/dirname
; it's just based off that branch.Description
Bash maintains the
$PWD
shell parameter with the current and correct full path to the present working directory. The shell builtinpwd
returns the value of$PWD
, so just skip the subshell and use the parameter directly.Motivation and Context
This is part of a patch set to reduce the use of subshells.
How Has This Been Tested?
Tested locally, and all tests pass.
Types of changes
...more of an optimization.
Checklist:
clean_files.txt
and formatted it usinglint_clean_files.sh
.