From 2a304fdfdfc953111d2ef55ad4ad46db3b834137 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Wed, 7 Feb 2018 09:25:24 +0100 Subject: [PATCH] Lowercase dirnames in pd to avoid env variables This is not foolproof, but most critical environment variables are all uppercase, so lowercase variables will be mostly safe. --- .zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 8800fe6..7037ace 100644 --- a/.zshrc +++ b/.zshrc @@ -44,7 +44,7 @@ pd(){ else pushd "$@" fi - namedir $(echo $(basename "$PWD" | tr -cd 'A-Za-z0-9_') | sed -e 's/^[0-9]/_&/') + namedir $(echo $(basename "$PWD" | tr -cd 'A-Za-z0-9_') | tr 'A-Z' 'a-z' | sed -e 's/^[0-9]/_&/') echo "$PWD" }