I have a machine running 7.2, samba file server for windows clients. The
software we use leave quite a bit of junk files for temp saves, crashes and
the like. I am attempting to have cron run a script to file from shared
directory with said extension. The problem are the (windows spaces), I
would like to avoid the extra overhead in renaming files I will delete
moments latter so...
this is where I am the attempting to pipe to sed to escape the "\ " the
space. Also tried to quote the full path. Both work from the command line?
What gives? Suggestions?
#! /bin/bash
# Purge Junk Files from Samba Drive
for ext in *.ac$ *.bak *.bk? back*.cdr *.chk *.dmp *.err *.sv$ *.tmp ~*.*
do
find /home2/Temp/Test -type f -iname "$ext" |
sed -e 's/[ ] [ ]*/ /g
s/[ ]/\\ /g' |
while read name
do
echo $name #I can see the output
to rm
rm -f $(echo $name)
done
done
_______________________________________________
Seawolf-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/seawolf-list