OK,
I searched and saw a couple of answers, but they didn't really apply to my script.
Here's a snippet from my script:
#!/bin/ksh
function build_ftp_script {
echo ${@:-} >> $ftp_script
}
function build_transfer_status {
if [[ -a $ftp_script ]] ; then
rm -f $ftp_script
fi
build_ftp_script "open $hostname"
# Get a list of files downloaded.
files=`/bin/ls incoming/tmp/*.zip 2>/dev/null`
for file in $files ; do
# Get the suffix.
echo $file
tmpfile=${file##incoming/tmp/}
build_ftp_script "rename ${tmpfile} ${tmpfile}.ftc"
done
}
build_transfer_status
exit 0
Now, if I encounter a .zip file with a space in it, it seperates the characters before and after the space into 2 seperate "files".
Any good ideas on how to avoid this? I've tried double quotes everywhere, nothing seems to work...
I searched and saw a couple of answers, but they didn't really apply to my script.
Here's a snippet from my script:
#!/bin/ksh
function build_ftp_script {
echo ${@:-} >> $ftp_script
}
function build_transfer_status {
if [[ -a $ftp_script ]] ; then
rm -f $ftp_script
fi
build_ftp_script "open $hostname"
# Get a list of files downloaded.
files=`/bin/ls incoming/tmp/*.zip 2>/dev/null`
for file in $files ; do
# Get the suffix.
echo $file
tmpfile=${file##incoming/tmp/}
build_ftp_script "rename ${tmpfile} ${tmpfile}.ftc"
done
}
build_transfer_status
exit 0
Now, if I encounter a .zip file with a space in it, it seperates the characters before and after the space into 2 seperate "files".
Any good ideas on how to avoid this? I've tried double quotes everywhere, nothing seems to work...