Prefer $(pwd) to $PWD
I'm unsure if this is idiomatic POSIX shell scripting or not, but I generally prefer function calls to variables. Thankfully things like Haskell don't differentiate between the two. In other cold and hostile environments like shell scripting, us programmers must take care to prefer functions to variables where it makes sense.
This commit is contained in:
parent
7167764622
commit
f5ace0b0a9
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@ fv() {
|
|||
tbz() {
|
||||
# Toggle between blaze-bin and your source.
|
||||
# Useful if you like to cd into the dir where your source lives.
|
||||
if [[ $PWD =~ '(.*)/blaze-bin(.*)' ]]; then
|
||||
if [[ "$(pwd)" =~ '(.*)/blaze-bin(.*)' ]]; then
|
||||
cd "${match[1]}${match[2]}"
|
||||
else
|
||||
cd "${PWD/\/google3//google3/blaze-bin}"
|
||||
|
|
Loading…
Reference in a new issue