From f5ace0b0a92e05fd4d1466556f2fd98ad4e6b776 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Sat, 23 Mar 2019 16:38:19 +0000 Subject: 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. --- configs/shared/zsh/functions.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configs/shared') diff --git a/configs/shared/zsh/functions.zsh b/configs/shared/zsh/functions.zsh index 815d90aefd85..3bf892355a92 100644 --- a/configs/shared/zsh/functions.zsh +++ b/configs/shared/zsh/functions.zsh @@ -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}" -- cgit 1.4.1