diff --git a/scripts/linkFiles.sh b/scripts/linkFiles.sh index 1590644..550513f 100755 --- a/scripts/linkFiles.sh +++ b/scripts/linkFiles.sh @@ -115,7 +115,7 @@ runDetachedScript() { shift; for srcFile in "$@"; do var=$(echo "$srcFile" | awk '{ sub(/.*dotfiles\/other\//, ""); print }') - varFolder=$(echo "$var" | sed "s/$(basename $var)//") + varFolder=${var//\/$(basename "$var")/} if [[ ! -d "/$varFolder" ]]; then mkdir -p "/$var" fi