gimping along
Drew Cohan <drewcohan@drewcohan.com> [2002-12-07 01:00:29 -0500]:
>
> Using a bash shell script (/bin/sh), I need to know how to check to
see
> if certain files exist in a directory, as in, "Are there any jpegs in
> this directory?". I've tried various things (like using -s, -f with
> test and a do/for loop) but nothing seems to work right. The closest
I
> can come is
>
> if test `ls /opt/images/*.jpg | wc -l` -gt 0 then ...
Thanks to everyone who provided the many different solutions to the
shell game. I've used several of them in my work and I've learned a bit
as well.
Now I'd like to know what to do about the following:
I'm working on a system whereby I receive emails via exim/fetchmail
(done), invoke a shell script via .forward (done), decode any jpg
attachements and save into a directory (done), and hand off those
pictures to the gimp (the shell game - done). The problem is that gimp
can't open an X display and dies. Obviously, if I invoke the script
from my xterm, it's fine. I've tried 'xhost +localhost' and have spent
most of the day googling to find the answer. I'm so close to victory I
can taste it. Anybody?
Thanks again,
-- Drew.
debian@drewcohan.com
Reply to: