From d593167696799241d89f535996adab19f94e50df Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Mon, 16 Jun 2014 23:24:41 -0700 Subject: [PATCH] fix quoted path --- lnf-function | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lnf-function b/lnf-function index 61478e7..1780c8e 100644 --- a/lnf-function +++ b/lnf-function @@ -39,8 +39,8 @@ replacing a file but not a directory. No ln option arguments are supported." elif [[ $# -ge 2 ]]; then if [[ -d ${!#} ]]; then local oldcwd=$PWD - cd ${!#} # last arg - for x in "${@:1:$(($#-1))}"; do # all but last arg + cd "${!#}" # last arg + for x in "${@:1:$(( $# - 1 ))}"; do # all but last arg # remove any trailing slashes x="${x%%+(/)}" # remove any leading directory components -- 2.30.2