GNU bug report logs - #20767
seq: support multiple % in -f format

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Severity: wishlist; Reported by: 積丹尼 Dan Jacobson <jidanni@HIDDEN>; dated Mon, 8 Jun 2015 02:07:02 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.
Changed bug title to 'seq: support multiple % in -f format' from 'seq invocation limitations documentation' Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 20767 <at> debbugs.gnu.org:


Received: (at 20767) by debbugs.gnu.org; 8 Jun 2015 15:09:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 08 11:09:07 2015
Received: from localhost ([127.0.0.1]:45337 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Z1yff-0006Lp-8y
	for submit <at> debbugs.gnu.org; Mon, 08 Jun 2015 11:09:07 -0400
Received: from homie.mail.dreamhost.com ([208.97.132.208]:59097
 helo=homiemail-a14.g.dreamhost.com)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <jidanni@HIDDEN>) id 1Z1yfZ-0006LL-DJ
 for 20767 <at> debbugs.gnu.org; Mon, 08 Jun 2015 11:09:01 -0400
Received: from homiemail-a14.g.dreamhost.com (localhost [127.0.0.1])
 by homiemail-a14.g.dreamhost.com (Postfix) with ESMTP id A1E54392087;
 Mon,  8 Jun 2015 08:08:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to:cc
 :subject:references:date:message-id:mime-version:content-type;
 s=jidanni.org; bh=q6rXq6qK0GGTEOfOHNUry3rlupI=; b=GyN9w2z3Z1G/h
 YFEA4WvSnJmxNu5FRxW8sWDxSOYPDLFQyTOfzg+nQHMQaiPCWSy9k2rYsz9lLUCu
 DXHo202M+eoiOQ5g/7Fx3EMsioBBhGW2cQyJblQat0BEWxpWwBpzKUmFV7YEcWEd
 3siG+VQSDuk1WrsLOMl3AzMrD4gibE=
Received: from jidanni.org (122-118-144-98.dynamic.hinet.net [122.118.144.98])
 (using TLSv1 with cipher AES128-SHA (128/128 bits))
 (No client certificate requested)
 (Authenticated sender: jidanni@HIDDEN)
 by homiemail-a14.g.dreamhost.com (Postfix) with ESMTPSA id 5D429392082;
 Mon,  8 Jun 2015 08:08:56 -0700 (PDT)
From: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson <jidanni@HIDDEN>
To: Stephane Chazelas <stephane.chazelas@HIDDEN>
Subject: Re: bug#20767: seq invocation limitations documentation
References: <87ioaz85eu.fsf@HIDDEN>
Date: Mon, 08 Jun 2015 23:08:53 +0800
Message-ID: <874mmi5jay.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20767
Cc: 20767 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Actually it would be great if one could just do
seq -f %d=0x%x 14484 10000 34484
where seq could just take the standard printf arguments, and % could be
used more than once, as I don't think it could mean any second argument...




Information forwarded to bug-coreutils@HIDDEN:
bug#20767; Package coreutils. Full text available.

Message received at 20767 <at> debbugs.gnu.org:


Received: (at 20767) by debbugs.gnu.org; 8 Jun 2015 09:09:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 08 05:09:44 2015
Received: from localhost ([127.0.0.1]:44651 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Z1t3v-0003It-Ia
	for submit <at> debbugs.gnu.org; Mon, 08 Jun 2015 05:09:43 -0400
Received: from mail-wg0-f49.google.com ([74.125.82.49]:36486)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <stephane.chazelas@HIDDEN>) id 1Z1t3s-0003Ie-Dw
 for 20767 <at> debbugs.gnu.org; Mon, 08 Jun 2015 05:09:41 -0400
Received: by wgbgq6 with SMTP id gq6so97788676wgb.3
 for <20767 <at> debbugs.gnu.org>; Mon, 08 Jun 2015 02:09:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:content-transfer-encoding
 :in-reply-to:user-agent;
 bh=9+2LccGUzAj//XKZ7G9tD6vyAWc1lqAvcMmwA3lu0Tc=;
 b=eJfM98UIXhTqs+QT7nDQ4y9BeuEiBncwgJrjfSv6N2xLwzhgQ9QxZKOtHUOnwYhh80
 5U53WwG5iniaZk7ABajmUo9uqmskocrhPoHi1QtjUYhwG/ktG+cHXOui9WfiM8w74GJI
 6wkTR3u2NLP3tmEp+aBkdcndWAetyVHW6/9MweiLAhl7w35zJxbMrCV0Mq4yFiENZAnw
 i8D8BJNX16zSTBwtsdeHCvTqK0DmQyFF86tTkgwVB8OZUh5oxAAeESD/5+Sd4PixnVK4
 ytcjr/vXJsWg/EPCw/sW6G+inctfQgd9rrK/CrHUDfh+MRLkaB59wrJbRPlSrW1ZCm26
 Frkw==
X-Received: by 10.180.9.111 with SMTP id y15mr19955541wia.18.1433754574788;
 Mon, 08 Jun 2015 02:09:34 -0700 (PDT)
Received: from chaz.gmail.com (05448b1b.skybroadband.com. [5.68.139.27])
 by mx.google.com with ESMTPSA id u9sm3215001wju.44.2015.06.08.02.09.33
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Mon, 08 Jun 2015 02:09:34 -0700 (PDT)
Date: Mon, 8 Jun 2015 10:09:33 +0100
From: Stephane Chazelas <stephane.chazelas@HIDDEN>
To: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson <jidanni@HIDDEN>
Subject: Re: bug#20767: seq invocation limitations documentation
Message-ID: <20150608090933.GA6261@HIDDEN>
References: <87ioaz85eu.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <87ioaz85eu.fsf@HIDDEN>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 20767
Cc: 20767 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

2015-06-08 07:28:25 +0800, 積丹尼 Dan Jacobson:
> On (info "(coreutils) seq invocation") perhaps mention if one needs to
> use two % items, a for loop might be required,
> 
> $ for i in `seq 14484 10000 34484`; do printf %d=0x%x\\n $i $i; done
> 14484=0x3894
> 24484=0x5fa4
> 34484=0x86b4
[...]

Running several commands in sequence in a loop like that (and
storing the whole output of seq in memory) is not so good an
idea. At this point, it's probably better to use awk:

awk 'BEGIN{for (i = 14484; i <= 34484; i += 10000)
  printf "%d=0x%x\n", i, i}'

See also
https://unix.stackexchange.com/questions/169716/why-is-using-a-shell-loop-to-process-text-considered-bad-practice

Might be worth pointing out awk as a standard alternative to seq
for portability btw.

-- 
Stephane




Information forwarded to bug-coreutils@HIDDEN:
bug#20767; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 8 Jun 2015 02:06:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 07 22:06:56 2015
Received: from localhost ([127.0.0.1]:44425 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Z1mSl-0008Dt-SI
	for submit <at> debbugs.gnu.org; Sun, 07 Jun 2015 22:06:56 -0400
Received: from eggs.gnu.org ([208.118.235.92]:46261)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <jidanni@HIDDEN>) id 1Z1mSj-0008Df-F1
 for submit <at> debbugs.gnu.org; Sun, 07 Jun 2015 22:06:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <jidanni@HIDDEN>) id 1Z1mSd-0000cY-6b
 for submit <at> debbugs.gnu.org; Sun, 07 Jun 2015 22:06:48 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:47428)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jidanni@HIDDEN>) id 1Z1mSd-0000cM-3I
 for submit <at> debbugs.gnu.org; Sun, 07 Jun 2015 22:06:47 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:59750)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jidanni@HIDDEN>) id 1Z1mSc-0002L3-8X
 for bug-coreutils@HIDDEN; Sun, 07 Jun 2015 22:06:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <jidanni@HIDDEN>) id 1Z1mSZ-0000XM-0q
 for bug-coreutils@HIDDEN; Sun, 07 Jun 2015 22:06:46 -0400
Received: from homie.mail.dreamhost.com ([208.97.132.208]:52569
 helo=homiemail-a14.g.dreamhost.com)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jidanni@HIDDEN>) id 1Z1mSY-0000Wv-QR
 for bug-coreutils@HIDDEN; Sun, 07 Jun 2015 22:06:42 -0400
Received: from homiemail-a14.g.dreamhost.com (localhost [127.0.0.1])
 by homiemail-a14.g.dreamhost.com (Postfix) with ESMTP id 5FB03392082
 for <bug-coreutils@HIDDEN>; Sun,  7 Jun 2015 19:06:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to
 :subject:date:message-id:mime-version:content-type; s=
 jidanni.org; bh=9g7vV2Ny6b3XD0aKyi3lFRLLfM0=; b=TVvXh7Z0fDjYXn/U
 7Zz4sjuM+gH5dpwlbtqu+6Ub2OiodUl49vRx3xb5tKM3uu1x/fBPm9/uEs7jzVEG
 YvrMbw4LoarfMzP7WLuSugjstoje2LZkch+cJUEcS2PHCPJHwhy4wZ+mNN/rI/e2
 rdyZG8v5YSI1xTQNIczP4jAmoMk=
Received: from jidanni.org (114-26-44-219.dynamic.hinet.net [114.26.44.219])
 (using TLSv1 with cipher AES128-SHA (128/128 bits))
 (No client certificate requested)
 (Authenticated sender: jidanni@HIDDEN)
 by homiemail-a14.g.dreamhost.com (Postfix) with ESMTPSA id 69844392061
 for <bug-coreutils@HIDDEN>; Sun,  7 Jun 2015 19:06:39 -0700 (PDT)
From: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson <jidanni@HIDDEN>
To: bug-coreutils@HIDDEN
Subject: seq invocation limitations documentation
Date: Mon, 08 Jun 2015 07:28:25 +0800
Message-ID: <87ioaz85eu.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
 timestamps) [generic]
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

On (info "(coreutils) seq invocation") perhaps mention if one needs to
use two % items, a for loop might be required,

$ for i in `seq 14484 10000 34484`; do printf %d=0x%x\\n $i $i; done
14484=0x3894
24484=0x5fa4
34484=0x86b4




Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#20767; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 23 Oct 2018 02:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.