From e55c4733c99be97623d70b22f19666d9b4511a5c Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sat, 18 May 2019 17:07:54 +0200 Subject: [PATCH] [shell/cd] add duoble quotes to prevent word splitting --- shell/cd.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shell/cd.sh b/shell/cd.sh index 929866e..eb43f73 100755 --- a/shell/cd.sh +++ b/shell/cd.sh @@ -1,13 +1,13 @@ #!/bin/sh #correct some fast tipped cds -function c { - if [ $1 == "d.." ]; then +c() { + if [ "$1" == "d.." ]; then cd ..; pwd; fi - if [ -d $1 ]; then - cd $1; + if [ -d "$1" ]; then + cd "$1"; pwd; fi return 0;