-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Use $PWD instead of $(pwd)
#1927
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
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
NoahGorny
left a comment
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
basenamedbranch has already been merged (#1926)! This PR does not do anything withbasename/dirname; it's just based off that branch.Description
Bash maintains the
$PWDshell parameter with the current and correct full path to the present working directory. The shell builtinpwdreturns 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.txtand formatted it usinglint_clean_files.sh.