Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Jul 2003 14:01:43 +0930
From:      Malcolm Kay <malcolm.kay@internode.on.net>
To:        "Peter Rosa" <prosa@pro.sk>, "freebsd-questions" <freebsd-questions@freebsd.org>
Subject:   Re: Fw: Problem with periodically done scripts
Message-ID:  <200307261401.43642.malcolm.kay@internode.on.net>
In-Reply-To: <02fd01c352f1$76e7bb00$3501a8c0@pro.sk>
References:  <02fd01c352f1$76e7bb00$3501a8c0@pro.sk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 26 Jul 2003 06:42, Peter Rosa wrote:
> > Well, I have tried it. When I type exactly the same command
> > awk -F: '$3=3D=3D0 {print $1,$3}' /etc/master.passwd | tee /dev/stder=
r |
>
> sed -e
>
> > '/^root 0$/d' -e '/^toor 0$/d' | wc -l
> > at prompt, it works well. So the error must be around [ -gt 0 -a -lt =
1 ]
>

Of course ...    [ -gt 0 -a -lt 1 ] is not a valid test!
Its not valid because $n expanded to blank in source:
      [ $n -gt 0 -a $rc -lt 1 ]

Also something wrong with $rc

[snip]

> >
> > separator
> > echo 'Checking for uids of 0:'
> > n=3D$(awk -F: '$3=3D=3D0 {print $1,$3}' /etc/master.passwd |
> >     tee /dev/stderr |
> >     sed -e '/^root 0$/d' -e '/^toor 0$/d' |
> >     wc -l)
> > [ $n -gt 0 -a $rc -lt 1 ] && rc=3D1
> >
=20
Malcolm Kay



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200307261401.43642.malcolm.kay>