From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11108 invoked from network); 29 Sep 2020 19:30:54 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 29 Sep 2020 19:30:54 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 7A0C49CF06; Wed, 30 Sep 2020 05:30:51 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 71D159CED4; Wed, 30 Sep 2020 05:30:15 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=ccil-org.20150623.gappssmtp.com header.i=@ccil-org.20150623.gappssmtp.com header.b="oGHu25ah"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id B1B519CED4; Wed, 30 Sep 2020 05:30:11 +1000 (AEST) Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) by minnie.tuhs.org (Postfix) with ESMTPS id BDC599CED0 for ; Wed, 30 Sep 2020 05:30:10 +1000 (AEST) Received: by mail-qt1-f174.google.com with SMTP id b2so4571312qtp.8 for ; Tue, 29 Sep 2020 12:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qBttX/Pd8YsMry8XfP8gnLuFvVyr61g3Wrp4qB4dtJA=; b=oGHu25ahkWHF6cf4WbW735shKswFcYLwuNSk9L+n2kLAIFAVhjjg+FlAnsmGZM+Jm5 ZCyI/91BeOaz6/J6wuBdi9ZmVG1OG6/uNxAX6O/NszrZjgPNbEXD/7HJEvnZyr6E+GCt aCb3A387L7/y3tn0vMM86u3DJA49Y3OiSbYpunFmajI8+dJBmaZd9zUTp9d5aRuy+6cA B/d8yrgGvX84OHwRAnR1a/p8r2PWzvWM1gb5wmjHgxm925i7DSZYf0pHc5h/RmwPoc4A bSzu0dTDYCBdSInvAro7Z4xgyu2CZlsi2YENR2bMGaXwL2OyGhSxQLTQ3hyo5314EOCP ggnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qBttX/Pd8YsMry8XfP8gnLuFvVyr61g3Wrp4qB4dtJA=; b=ryokdKn70ImcYYkNPUTESQd6A4mb/zAsezdw+3KVgGZ3Cykqgeb7UDk2KQtGRBhuCO uzG37zRkmWAmEInkjdmxwVbvLe/DI9x87islRoiplXJFhfe8W4RJTnVAgLdDSHsFg5PY 5odclZ10mexBMd7DhxQgqqVQQCwOnEqqv6wxN7PP1e1JVN7P0KdI3hH/c/JwxB7uzAV5 RH134nXtdCgBMzHG3e+XrYf2eXKVmfRIr/puDYfuRxSsqkohesN2jlhhqMOln3AL9ojW 4wGRBWN/mEOzg80xMrrswLYbkGQWw8NWT3d8+CCYS8LNIKT0j2Pvm4EXNGR9zCpyYf/W 5qMQ== X-Gm-Message-State: AOAM5315E/2Wec6tH2Gq5ZTP5NPVYRuPK2mHbnXtW9J838537FeXZ/fK AgDtHkrZ+YAxr3Hf6JmIUAIyXcDGEE6+7MzAYUp7vQ== X-Google-Smtp-Source: ABdhPJxuIQZwB4XVPgKsuFj4y4kZwW/9vYoriT705uUNaHoY7ef0u+v1oa9imFMhSu6I1LUqQzshaajlkvwLl7XOW9k= X-Received: by 2002:ac8:1a7b:: with SMTP id q56mr5017154qtk.56.1601407809838; Tue, 29 Sep 2020 12:30:09 -0700 (PDT) MIME-Version: 1.0 References: <300084CC-77EA-44D4-9DB1-DC321B9F3F0B@kdbarto.org> In-Reply-To: <300084CC-77EA-44D4-9DB1-DC321B9F3F0B@kdbarto.org> From: John Cowan Date: Tue, 29 Sep 2020 15:29:59 -0400 Message-ID: To: david@kdbarto.org Content-Type: multipart/alternative; boundary="000000000000a5793d05b078cf7d" Subject: Re: [TUHS] SH script formatting X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --000000000000a5793d05b078cf7d Content-Type: text/plain; charset="UTF-8" There seems to have been a migration over time from the first format to the second, perhaps a result of C programmers not having a keyword "then", which Bourne shells (following Algol 68) require. I don't think it matters much. On Tue, Sep 29, 2020 at 2:52 PM David Barto wrote: > In a brief discussion with a coworker today the question of formatting > shell scripts came up. > > I believed that in the past the preferred format (if there ever were any > such thing) was > > if [ test ] > then > statements > else > statements > fi > > I can find nothing specific to back this up. More appropriate for COFF > maybe would > be a discussion of what format is better > > if [ test ]; then > statements > else > statements > fi > > or the above. > > No intention to start any kind of flame war about which is better, just > want to see > if there is any historical option for one over the other. > > David --000000000000a5793d05b078cf7d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
There seems to have=C2=A0been a migration over time from t= he first format to the second, perhaps a result of C programmers not having= a keyword "then", which Bourne shells (following Algol 68) requi= re.=C2=A0 I don't think it matters much.

On Tue, Sep 29, 2020 at 2:52 PM= David Barto <david@kdbarto.org= > wrote:
In a= brief discussion with a coworker today the question of formatting shell sc= ripts came up.

I believed that in the past the preferred format (if there ever were any su= ch thing) was

if [ test ]
then
=C2=A0 =C2=A0 =C2=A0 =C2=A0 statements
else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 statements
fi

I can find nothing specific to back this up. More appropriate for COFF mayb= e would
be a discussion of what format is better

if [ test ]; then
=C2=A0 =C2=A0 =C2=A0 =C2=A0 statements
else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 statements
fi

or the above.

No intention to start any kind of flame war about which is better, just wan= t to see
if there is any historical option for one over the other.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 David
--000000000000a5793d05b078cf7d--