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

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

On Sat, Mar 25, 2000 at 05:49:48PM -0600, John R. Dennison wrote:

> Sorry, its force of habit to think of /bin/sh as a Bourne work-alike shell,
> which is generally a fairly safe bet.  This works in bash, and I have used
> like constructs in Sys-V release platforms in the past.  

/bin/sh should *always* be a bourne-like shell.

> > 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 *:

However, it's a bourne shell that has problems.  Off the top of my head
the following should work in a bourne shell:

  if [ "$(ls /var/spool/news/out.going)" = "" ]; then
      /usr/sbin/fetchnews -P

I don't recall if the $() is plain-sh or not - if not, backticks could
be used instead.  I've got a horrible feeling I'm missing something
here, though.

Mark Brown  mailto:broonie@xxxxxxxxxxxxxxx   (Trying to avoid grumpiness)
EUFS        http://www.eusa.ed.ac.uk/societies/filmsoc/

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