From patchwork Thu Aug 4 05:54:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kylie McClain X-Patchwork-Id: 9262923 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E45BA60754 for ; Thu, 4 Aug 2016 08:20:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D636A2832E for ; Thu, 4 Aug 2016 08:20:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA5CB28336; Thu, 4 Aug 2016 08:20:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A49A2832E for ; Thu, 4 Aug 2016 08:20:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754030AbcHDIU4 (ORCPT ); Thu, 4 Aug 2016 04:20:56 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:33717 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751857AbcHDIUy (ORCPT ); Thu, 4 Aug 2016 04:20:54 -0400 Received: by mail-qt0-f196.google.com with SMTP id j37so12524085qta.0 for ; Thu, 04 Aug 2016 01:20:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=vCDIeEEt4cnEjviey7vqgRrQSuW7sqy3v02sRhs2Pnw=; b=Nk0jznzrP9tSI6IkSVHNSiR3pSPm8p28qGjjAbPM47NWZymQe+sNzR36P0pPWls5RN FNXgo0RB+sRBMZ4003GW9Ty/HkzTLkvGhmPZu2ZRcaPKgtZRryI6byjAqJueNjvC2SAS fqkqz9esqkqIbhTzgouw75hfwhV0kMwNM3M1IYiB9H4nYwd19uvjQGxTG4iCdPI1xGdr N0goJOV7qbuRhy4+7sUWJXZbhjSaxXSD440JCa379xFON4MrshigT1xLyTHmDYd4wRtT ITWRXQ3r/5ANg5ryTUTb97Il1Lqs2ED8wzwjkp+ZKl2lPH6mso26/4Z1UN+OYkyAOS63 QMPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=vCDIeEEt4cnEjviey7vqgRrQSuW7sqy3v02sRhs2Pnw=; b=ODkn6j4K5IZBmOa65etT5i37gPeOKE10SdqGOIbjdhGotXxSKMUp+nMBO5XOMuwp7+ 5iiGJkMBFjaFkDi+zS2c2JBzCKKOTs8B4Gvo8TCr3iwVB2CuGR9E9BRvZlS7F0PE8NKA ECxpSXRCGcHUkoMU8IVh179afVZR+L9cSZ7uxrLsdwzwHRTI7kr/VLrTLgKJQixHR5jo Y+8AkYLNXGXujXsTHK/9ySeSDOlKT3Qk85aEAT0amjhzYSjWO9/S8FX2J7dx1zI2+Ref 1MRopqxXUCIsndjvvtxKGZXj0NWu/4IYc37mdS11fthsNJFzesdn1pe7gACaKgY347+f c4Aw== X-Gm-Message-State: AEkoousTvl0hrnRIuDSMvIZirjWn8QFK3TkMtPyGgjOwzoDsOcksFr/EWZDgI8eUp7zrxQ== X-Received: by 10.237.45.34 with SMTP id h31mr4347496qtd.101.1470290054101; Wed, 03 Aug 2016 22:54:14 -0700 (PDT) Received: from localhost.localdomain (cpe-65-184-25-62.carolina.res.rr.com. [65.184.25.62]) by smtp.gmail.com with ESMTPSA id u44sm6122888qtc.27.2016.08.03.22.54.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Aug 2016 22:54:13 -0700 (PDT) From: Kylie McClain To: dash@vger.kernel.org Cc: Kylie McClain Subject: [PATCH 1/2] mkbuiltins: Use a `while` loop rather than `nl` Date: Thu, 4 Aug 2016 01:54:10 -0400 Message-Id: <20160804055411.23558-1-somasissounds@gmail.com> X-Mailer: git-send-email 2.9.0 Sender: dash-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dash@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kylie McClain nl, while specified in POSIX, is rather obscure and isn't provided by small coreutils implementations such as `busybox`. This while loop works just as well for our purposes. --- src/mkbuiltins | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mkbuiltins b/src/mkbuiltins index b4d6f4e..a47bce8 100644 --- a/src/mkbuiltins +++ b/src/mkbuiltins @@ -101,7 +101,8 @@ cat <<\! */ ! -sed 's/ -[a-z]*//' $temp2 | nl -ba -v0 | +sed 's/ -[a-z]*//' $temp2 | while read line;do \ + i=$(( ${i:--1} + 1 )); printf '%s %s\n' "${i}" "${line}";done | LC_ALL= LC_COLLATE=C sort -u -k 3,3 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | awk '{ printf "#define %s (builtincmd + %d)\n", $3, $1}'