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

Re: [leafnode-list] Re: Fetchnews and Shell Script



Stefan Troeger wrote:

> On Sat, Mar 25 2000 at 14:53 -0600, John R. Dennison wrote:

> > #!/bin/sh
> > 
> > cd /var/spool/news/out.going
> > 
> > if [ -f * ]
> > then
> >       echo "executing fetchnews -P"
> > 	/usr/local/sbin/fetchnews -P
> > 	exit $?
> > fi
> > 
> > exit 0
> 
> Depending on the shell you're using this may work or not. It does
> fine in zsh, but in bash it will only work if there are less then
> two files that match *:
> 
> [sttr]/home/sttr/1> touch foo bar com
> [sttr]/home/sttr/1> if [ -f * ]; then echo; fi
> [: too many arguments

How about that?

if [ ! `find /var/spool/news/out.going -type d -empty` ]; then
    ...
fi


christian


-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list