Parse file names with spaces

If you have a file containing absolute paths with spaces in them this script should handle it

 

#!/bin/bash

OIFS="$IFS"
IFS=$'\n'

if [[ $# == 0 ]]; then
echo "ERROR: This script requires at least 1 argument"
exit
fi

for line in `cat ./$1MailAttachments.txt`; do cp "$line" /data2/Apps/tmp/leo/$1/MailAttachments/; done

IFS="$OIFS"

Previous page: Postfix Setup
Next page: Remove all .svn folders


From bland to brand, get your business online
Website hosting and design by Dedicated to Servers, contact info@dedicatedtoservers.com

Click to send a quick inquiry

All rights Reserved © 2014-2024