summaryrefslogtreecommitdiff
path: root/etc/functions
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-08-03 00:27:21 +0200
committerDaniel Friesel <derf@finalrewind.org>2014-08-03 00:27:21 +0200
commitc3b0bbabf78a4099bf278ad2edd38a0bb0e5af6a (patch)
treee32d1768c83d8fa6425fe389e6a543325962b5f7 /etc/functions
parent1c455c14f94b1e804e02cb7283be8ad74d5fec6a (diff)
put: support spaces in filenames
Diffstat (limited to 'etc/functions')
-rw-r--r--etc/functions/put8
1 files changed, 4 insertions, 4 deletions
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
}