dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jca+dash@wxcvbn.org (Jérémie Courrèges-Anglas)
To: Aleksey Cheusov <vle@gmx.net>
Cc: dash@vger.kernel.org
Subject: Re: patch for dash
Date: Sun, 06 Jan 2013 18:37:34 +0100	[thread overview]
Message-ID: <87bod2fc0x.fsf@moo.wxcvbn.org> (raw)
In-Reply-To: <87a9sms281.fsf@asrock.chizhovka.net> (Aleksey Cheusov's message of "Sun, 06 Jan 2013 19:30:54 +0300")

[-- Attachment #1: Type: text/plain, Size: 560 bytes --]

Aleksey Cheusov <vle@gmx.net> writes:

> Hi. The following patch fixes dash build failure on Solaris
> where /usr/bin/nl (which is in default PATH) is not POSIX compatible.
> POSIX-ly correct version is in /usr/xpg4/bin but I think it's easier
> to fix use of nl(1).

Hi.  I'd like to submit this slightly different patch that uses awk
instead of nl.  This is useful for example on OpenBSD, which doesn't have
nl in the base system.

Regards,
-- 
Jérémie Courrèges-Anglas
GPG Fingerprint: 61DB D9A0 00A4 67CF 2A90  8961 6191 8FBF 06A1 1494


[-- Attachment #2: patch-src_mkbuiltins --]
[-- Type: application/octet-stream, Size: 549 bytes --]

--- src/mkbuiltins.orig	Sat Sep 29 21:11:04 2012
+++ src/mkbuiltins	Sat Sep 29 21:25:49 2012
@@ -97,8 +97,9 @@ cat <<\!
  */
 
 !
-sed 's/	-[a-z]*//' $temp2 | nl -b a -v 0 | LC_COLLATE=C sort -u -k 3,3 |
-tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |
+sed 's/	-[a-z]*//' $temp2 | awk '{ printf "%6d\t%s\n", NR-1, $0 }' |
+	LC_COLLATE=C sort -u -k 3,3 |
+	tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |
 	awk '{	printf "#define %s (builtincmd + %d)\n", $3, $1}'
 printf '\n#define NUMBUILTINS %d\n' $(wc -l < $temp2)
 echo '

  reply	other threads:[~2013-01-06 17:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-06 16:30 patch for dash Aleksey Cheusov
2013-01-06 17:37 ` Jérémie Courrèges-Anglas [this message]
2013-01-10 10:46   ` (another) " Jérémie Courrèges-Anglas
2013-08-23 10:42     ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bod2fc0x.fsf@moo.wxcvbn.org \
    --to=jca+dash@wxcvbn.org \
    --cc=dash@vger.kernel.org \
    --cc=vle@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).