Ariën Huisken wrote:
> Hmm, wont work here. Isn't there a simple inverse on
> for image in $WORKDIR/$INPUT/*.{crw,CRW}; do
Not directly..
If there are never occur spaces in any file, you could use;
for image in `ls -w1 $WORKDIR/$INPUT/* | egrep -viq 'crw$'`; do
But I don't really see why my last suggestion "wont work" ..
If it *doesn't* work, something is just likely slightly off..
well, $foo at the end of grep certainly won't work..
# for i in *; do echo $i | egrep -qi 'php$'; if [ $? -gt 0 ]; then echo
$i; fi done
<lots of files and folders in the current dir not ending in php>
The for and if would replace parts of my original snippet, much like so:
.. Again, don't splash code into place using rm without testing
rigorously first.
if [ -n "`ls incoming/`" ]; then
for srcrpm in incoming/*; do
echo $srcrpm | grep -qi 'crw$'
if [ $? -gt 0 ]; then
echo "erasing $i"
rm -f $srcrpm
elif [ -f $srcrpm -a -z "`lsof $srcrpm 2>/dev/null`" ]; then
echo -n "$srcrpm "
...
fi
done
fi
--
Cheers,
Morten
:wq
_______________________________________________
tsl-discuss mailing list
[email protected]
http://lists.trustix.org/mailman/listinfo/tsl-discuss