From: Ian Kelling Date: Tue, 17 Jun 2014 06:24:41 +0000 (-0700) Subject: fix quoted path X-Git-Url: https://iankelling.org/git/?p=lnf;a=commitdiff_plain;h=d593167696799241d89f535996adab19f94e50df;ds=sidebyside fix quoted path --- 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