From owner-freebsd-doc Thu Jun 28 23:55:35 2001 Delivered-To: freebsd-doc@freebsd.org Received: from bsd.electromir.ru (bsd.electromir.ru [195.14.44.190]) by hub.freebsd.org (Postfix) with ESMTP id E243837B405 for ; Thu, 28 Jun 2001 23:55:29 -0700 (PDT) (envelope-from dimma@electromir.ru) Received: from mail.office.electromir.ru (mail.office.electromir.ru [192.168.0.50]) by bsd.electromir.ru (8.11.3/8.11.3) with SMTP id f5T6rVn24943; Fri, 29 Jun 2001 10:53:36 +0400 (MSD) Received: from electromir.ru ([192.168.0.35]) by mail.office.electromir.ru (Lotus SMTP MTA v4.6.6 (890.1 7-16-1999)) with SMTP id C3256A7A.0025D418; Fri, 29 Jun 2001 10:53:11 +0400 Message-ID: <3B3C262E.B44B479D@electromir.ru> Date: Fri, 29 Jun 2001 10:54:38 +0400 From: Dmitriy Kyrhlarov X-Mailer: Mozilla 4.72 [en] (Win95; I) X-Accept-Language: ru,en MIME-Version: 1.0 To: Dave Tweten Cc: Pete Fritchman , freebsd-doc@FreeBSD.ORG Subject: Re: Fw: Re: Bourne Shell Syntax Wierdness References: <8389E4C083FF6622C3256A7A0019EB8A.0019EBE9C3256A7A@electromir.ru> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi! 1. sorry for my english. :-) Dave Tweten wrote: > > petef@databits.net said: > >you first take 'true || true' -- you end up with true. > > According to the man page, "||" is NOT "or". Instead it is an operator > that > causes the command to its right to be executed only if the simple command > to > its left fails. Therefore, 'true || true' means "continue without > executing > the rightmost "true". I can't understand where is a problem? true || true && echo "oops!" prints "oops!" true || echo "not oops!" && echo "oops!" prints "oops!" i.e. true || command 1 && command 2 equivalent: true && command 2 and it's a right... > command1 [ || command2 ] ... > command1 [ && command2 ] ... > Curiously, POSIX says nothing about a list containing both operators. pay attantion: "||" and "&&" -- part of command2, therefore true [ || command1 ] [ && command2 ] we can write: true [ && command2 ] By. Dmitriy To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message