Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Jul 2003 00:17:46 +0200
From:      "Peter Rosa" <prosa@pro.sk>
To:        "Lowell Gilbert" <freebsd-questions-local@be-well.no-ip.com>
Cc:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: Problem with periodically done scripts
Message-ID:  <033601c352fa$93aa0280$3501a8c0@pro.sk>
References:  <020d01c352dc$0ef7a7e0$3501a8c0@pro.sk><028101c352dd$d87ee230$2401010a@zone3000.net><023301c352e0$b17fcac0$3501a8c0@pro.sk><44oezigwdm.fsf@be-well.ilk.org><02f701c352f1$62f00940$3501a8c0@pro.sk> <44wue68ebs.fsf@be-well.ilk.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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@be-well.no-ip.com>
To: "Peter Rosa" <prosa@pro.sk>
Sent: Friday, July 25, 2003 11:51 PM
Subject: Re: Problem with periodically done scripts


> "Peter Rosa" <prosa@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.
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?033601c352fa$93aa0280$3501a8c0>