From owner-freebsd-questions@FreeBSD.ORG Fri Jul 25 15:18:24 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BDDDE37B401 for ; Fri, 25 Jul 2003 15:18:24 -0700 (PDT) Received: from ns.pro.sk (proxy.pro.sk [195.80.161.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D72443FB1 for ; Fri, 25 Jul 2003 15:18:22 -0700 (PDT) (envelope-from prosa@pro.sk) Received: from peter (Peter [192.168.1.53]) by ns.pro.sk (8.11.3/8.11.3) with SMTP id h6PMIDE88078; Sat, 26 Jul 2003 00:18:13 +0200 (CEST) (envelope-from prosa@pro.sk) Message-ID: <033601c352fa$93aa0280$3501a8c0@pro.sk> From: "Peter Rosa" To: "Lowell Gilbert" 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> Date: Sat, 26 Jul 2003 00:17:46 +0200 Organization: PRO, s.r.o. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 cc: freebsd-questions Subject: Re: Problem with periodically done scripts X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jul 2003 22:18:25 -0000 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" To: "Peter Rosa" Sent: Friday, July 25, 2003 11:51 PM Subject: Re: Problem with periodically done scripts > "Peter Rosa" 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. >