From c3b0bbabf78a4099bf278ad2edd38a0bb0e5af6a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 3 Aug 2014 00:27:21 +0200 Subject: put: support spaces in filenames --- etc/functions/put | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'etc/functions/put') diff --git a/etc/functions/put b/etc/functions/put index 62aaebc..f15274d 100644 --- a/etc/functions/put +++ b/etc/functions/put @@ -112,10 +112,10 @@ while (( ${#hosts} )) { if [[ ${remote_file} == ${~illegal} ]] { remote_file=${remote_file:r} } - lftp -c "connect sftp://${ssh_name}; cd ${target_dir}; put ${file}"\ -" -o ${remote_file}; chmod 644 ${remote_file}" - if $(curl -fI ${server_prefix}${remote_file} &> /dev/null); then - echo ${server_prefix}${remote_file} + lftp -c "connect sftp://${ssh_name}; cd ${target_dir}; put '${file}'"\ +" -o '${remote_file}'; chmod 644 '${remote_file}'" + if $(curl -fI ${server_prefix}${remote_file// /%20} &> /dev/null); then + echo ${server_prefix}${remote_file// /%20} return 0 fi } -- cgit v1.2.3