[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Whitespace problem with bash script for Icedove



Hi folks,

I'm piecing together a small script to remove duplicate messages from various directories in Icedove. By default the files are stored in a directory called 'Local Folders' - with the space - and this seems to be
creating a problem for bash. I can both cd to "Local Folders" and cd to
Local\ Folders from the command line but within the script it's a different story. Bash refuses to recognize "Local Folders" as a directory and breaks at the whitespace. Here's the script and the error output. Any help appreciated.

	bill

#! /bin/bash

# A script to remove duplicate messages

FILES=/home/bill/.icedove/qjimvr85.default/Mail/Local\ Folders/2-Personal.sbd/* # or "/home/bill/.icedove/qjimvr85.default/Mail/Local Folders/2-Personal.sbd/*"

for i in $FILES
do
        mv "$i" ""$i".saved"
        formail -D 65536 .msgid.cache -s < ""$i".saved" > "$i"
done

mv: cannot stat `/home/bill/.icedove/qjimvr85.default/Mail/Local': No such file or directory ./mailscript: line 10: /home/bill/.icedove/qjimvr85.default/Mail/Local.saved: No such file or directory
mv: cannot stat `Folders/2-Personal.sbd/*': No such file or directory
./mailscript: line 10: Folders/2-Personal.sbd/*.saved: No such file or directory


Reply to: