hello all,
I work at a newspaper, and we use QuarkXPress for Desktop publishing...and we have a pretty unfortunate glitch, when Quark crashes, it seems to untick the backup option in the pref's...
so I was thinking this would be a good place for a small recursive script, that would run in the background, and copy all open quark documents, to a users ~/Desktop/Backups/ dir. then wait 7-10mins, and run again...I have a good idea where im going with most of it, but i have (what i think) is a small hangup. where I'm going so far is:
lsof |grep QuarkXP|awk '{ print $9,$10,$11,$12 ]'>/tmp/output1
This gives me all of the Quark open files, but leaves the first line with a /
so I used:
sed '1d' /tmp/output1>output2
that line removes that 1st / for me, then im left with a huge list of files.
Id like to be able to:
cp `cat /tmp/output2` ~/Desktop/Backups
but the problem is, some of the paths have spaces in them, that cannot be removed, so i would need to append a \ infront of them to make it work...and that's where im stuck, i rtfm for sed, and some of awk, and being trying the google for a grep solution, but no bones either way.
any help would greatly appreciated, thanks.
...As I wrote this, i might've had a lightbulb. couldn't i use sed to append every line in the beginning and end with a " that way it includes the spaces?