Problem with periodically done scripts

Peter Rosa prosa at pro.sk
Fri Jul 25 15:18:25 PDT 2003


Dear Gilbert,

I have replaced wc with make install from /usr/src/usr.bin/wc and now it
works. Up now wc -l gave no results, now it give proper number.

Could you, please, explain the following line: [ $n -gt 0 -a $rc -lt 1 ] ???
Why are there [] ? When I write it at prompt as
[0 -gt 0 -a - lt 0] it writes [: 0: unexpected operator, but
[0 -gt 0 -a -lt ] writes nothing.
What is it ? What type of command is written such kind ?

Peter Rosa

P.S. Now awk -F: '$3==0 {print $1,$3}' /etc/master.passwd | tee /dev/stderr
| sed -e '/^root 0$/d' -e '/^toor 0$/d' | wc -l returns
root 0
toor 0
         1

PR


----- Original Message -----
From: "Lowell Gilbert" <freebsd-questions-local at be-well.no-ip.com>
To: "Peter Rosa" <prosa at pro.sk>
Sent: Friday, July 25, 2003 11:51 PM
Subject: Re: Problem with periodically done scripts


> "Peter Rosa" <prosa at pro.sk> writes:
>
> > Well, I have tried it. When I type exactly the same command
> > awk -F: '$3==0 {print $1,$3}' /etc/master.passwd | tee /dev/stderr |
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 ]
&&
> > rc==1
>
> > echo 'Checking for uids of 0:'
> > n=$(awk -F: '$3==0 {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=1
>
> Note the $n.
> n should be zero after the previous command.
>



More information about the freebsd-questions mailing list