From owner-freebsd-bugs Wed Sep 23 12:20:41 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA25672 for freebsd-bugs-outgoing; Wed, 23 Sep 1998 12:20:41 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA25614; Wed, 23 Sep 1998 12:20:29 -0700 (PDT) (envelope-from dag-erli@ifi.uio.no) Received: from hrotti.ifi.uio.no (2602@hrotti.ifi.uio.no [129.240.64.15]) by ifi.uio.no (8.8.8/8.8.7/ifi0.2) with ESMTP id VAA23461; Wed, 23 Sep 1998 21:20:16 +0200 (MET DST) Received: (from dag-erli@localhost) by hrotti.ifi.uio.no ; Wed, 23 Sep 1998 21:20:15 +0200 (MET DST) Mime-Version: 1.0 To: Studded Cc: Drew Derbyshire , freebsd-bugs@FreeBSD.ORG, freebsd-gnats-submit@FreeBSD.ORG Subject: Re: conf/8031: /etc/rc looks for /etc/sendmail.cf at startup References: <199809231210.FAA18954@freefall.freebsd.org> <360936D5.9DAE1280@dal.net> Organization: University of Oslo, Department of Informatics X-url: http://www.stud.ifi.uio.no/~dag-erli/ X-other-addresses: 'finger dag-erli@ifi.uio.no' for a list X-disclaimer-1: The views expressed in this article are mine alone, and do X-disclaimer-2: not necessarily coincide with those of any organisation or X-disclaimer-3: company with which I am or have been affiliated. X-Stop-Spam: http://www.cauce.org/ From: dag-erli@ifi.uio.no (Dag-Erling C. =?iso-8859-1?Q?Sm=F8rgrav?= ) Date: 23 Sep 1998 21:20:15 +0200 In-Reply-To: Studded's message of "Wed, 23 Sep 1998 10:58:45 -0700" Message-ID: Lines: 27 X-Mailer: Gnus v5.5/Emacs 19.34 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.freebsd.org id MAA25664 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Studded writes: > This isn't directed towards Drew, but technically the RHS of the test > should be "XYES" instead of how it is now. The '=' conditional compares > strings, so the LHS is correct, and it should be the same on both sides. > [...] > > ! if [ "X${sendmail_enable}" = X"YES" ]; then > > echo -n ' sendmail'; /usr/sbin/sendmail ${sendmail_flags} > > fi The X is totally unnecessary as long as you have quotes around the variable to make sure you get an empty string (rather than a missing argument) if it's undefined or empty. [ "${sendmail_enable}" = YES ] && echo -n ' sendmail' && /usr/sbin/sendmail ${sendmail_flags} Might as well throw in a ${sendmail_program} for good measure: [ "${sendmail_enable}" = YES ] && echo -n ' sendmail' && ${sendmail_program} ${sendmail_flags} I prefer to place the echo command last so that ' sendmail' is not printed unless sendmail started successfully. DES -- Dag-Erling Smørgrav - dag-erli@ifi.uio.no To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message