Hello there,
I have an issue with spaces in the path of the files.
Here is the issue:
Code:
#! /bin/bash
date=$( date +%y_%m_%d_ )
for filetodelete in $( cat c:/Program\ Files/Serv-U/HouseKeeping/log/${date}file_to_delete.txt ); do
/usr/bin/echo "${filetodelete}"
# The last action will be "rm -f" intead of "echo"
done
and the file "07_10_05_file_to_delete.txt" is look like:
Code:
/cygdrive/f/FTPRoot/dropbox/log.zip
/cygdrive/f/FTPRoot/dropbox/report-20070911.zip
/cygdrive/f/FTPRoot/dropbox/Issues with Server.txt
but when I run this script each time it meet a " " it echo the rest of the line on a new line which is giving me some thing like this:
Code:
/cygdrive/f/FTPRoot/dropbox/log.zip
/cygdrive/f/FTPRoot/dropbox/report-20070911.zip
/cygdrive/f/FTPRoot/dropbox/Issues
with
Server.txt
How to prevent the space to be taken as a new line?
Regards,