GNU bug report logs - #52525
wanted to add option to date command to handle pure numeric input in varying ways and output for invalid dates

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; Reported by: Mike Marchywka <marchywka@HIDDEN>; dated Wed, 15 Dec 2021 21:58:01 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.

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


Received: (at 52525) by debbugs.gnu.org; 15 Dec 2021 22:09:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 15 17:09:40 2021
Received: from localhost ([127.0.0.1]:33903 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mxcSy-0007Lk-4O
	for submit <at> debbugs.gnu.org; Wed, 15 Dec 2021 17:09:40 -0500
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:41570)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1mxcSv-0007LV-9j
 for 52525 <at> debbugs.gnu.org; Wed, 15 Dec 2021 17:09:39 -0500
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2896E16010D;
 Wed, 15 Dec 2021 14:09:31 -0800 (PST)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id FekGfbtFjJyP; Wed, 15 Dec 2021 14:09:30 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 7B78916011F;
 Wed, 15 Dec 2021 14:09:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id c67EuH-A8_5k; Wed, 15 Dec 2021 14:09:30 -0800 (PST)
Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com
 [172.91.119.151])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 53D3A16010D;
 Wed, 15 Dec 2021 14:09:30 -0800 (PST)
Message-ID: <e716cd77-7d02-24da-ed12-55159501cf67@HIDDEN>
Date: Wed, 15 Dec 2021 14:09:29 -0800
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.3.1
Subject: Re: bug#52525: wanted to add option to date command to handle pure
 numeric input in varying ways and output for invalid dates
Content-Language: en-US
To: Mike Marchywka <marchywka@HIDDEN>
References: <BN7PR08MB5571CCE76CB62D8DD9A31CCEBE769@HIDDEN>
 <BN7PR08MB55717506A5B39838E986288BBE769@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
In-Reply-To: <BN7PR08MB55717506A5B39838E986288BBE769@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.4 (--)
X-Debbugs-Envelope-To: 52525
Cc: 52525 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
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: -3.4 (---)

On 12/15/21 12:39, Mike Marchywka wrote:
> $echo 2000 | date +%Y -f-
> 2021

How about this instead? The idea is to avoid adding features if they can 
easily be implemented with some other standard utility. This way, you 
can write your shell scripts now rather than waiting for a future fix 
(plus, it keeps 'date' simpler).

echo 2000 | sed 's/$/-07-01/' | date +%Y -f-





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

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


Received: (at submit) by debbugs.gnu.org; 15 Dec 2021 21:57:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 15 16:57:30 2021
Received: from localhost ([127.0.0.1]:33878 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mxcHB-0006xz-JZ
	for submit <at> debbugs.gnu.org; Wed, 15 Dec 2021 16:57:30 -0500
Received: from lists.gnu.org ([209.51.188.17]:51362)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <marchywka@HIDDEN>) id 1mxbMk-00012R-60
 for submit <at> debbugs.gnu.org; Wed, 15 Dec 2021 15:59:10 -0500
Received: from eggs.gnu.org ([209.51.188.92]:39008)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <marchywka@HIDDEN>)
 id 1mxbMh-0005iD-L7
 for bug-coreutils@HIDDEN; Wed, 15 Dec 2021 15:59:09 -0500
Received: from mail-dm6nam11olkn2089.outbound.protection.outlook.com
 ([40.92.19.89]:21251 helo=NAM11-DM6-obe.outbound.protection.outlook.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <marchywka@HIDDEN>)
 id 1mxbMe-0005Hb-T4
 for bug-coreutils@HIDDEN; Wed, 15 Dec 2021 15:59:06 -0500
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=oR6CzN8qiOq77pyGnEpea2mMHLCVyiv1IZ89dZ33k8tOzXdp6BN91sp7gMt2q1KODayOAvrDouYhbqcsdgktUEok5kvy6RjkC8Ux/G2behX6mPLm2/PgrhMG8QSBHcuSdfvKoMKAGPyas7vIenDUqn7fXB1b6AZ/yMJ0sIwP5rDemqPWJovZ/rEzMV4NTvm0uzBfyHNCJ0/8F0Se8aZFQAujx263oAfoU+HQoliGBA2r95jX6yHMdyNCR8mWxF8A4YCGDlDukiyOiiMW/pM/J5mOLf4u1eulVlV0ZTFNv60Fdy9ZQr9/m80hOtK4Ru1TxbjA5gt3NH+4+GG+/3veMQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4WO8KlPLBkUtDJPMQVEH7Hg+E9S0RLGujge7Z6FHMzk=;
 b=WUqTtwhZ784U9Xm+8gyNt+2cI9o40ZQs1RBxLcJg++1wUBJg5YIXmU/DnxzIPSAEyqdz34mcasAmoCk+A6TEs2KXalKVE3q9JbGYn2HocfEQElTQCUgRsfCZBzqOIeTXMq/hx4jypr6cUP6kl4xzLgzRkNAdtJ/uiwlnnyTzdqkIiKwr0DMbxoEJDhbgStAQH3ON09kRu5t3UE0Ibmm76mjdpSWnelWqS371Djjj7u8Bo5Zd/kQhr8z6fvvRLvGa0qyLPAcmzh8+2daV2y/IlZFl3osytVT7mPygpmh8YWC+xq/HWGXd38jICg/hqfnar1qplRY+UyzWW7gl+8u/9w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
 dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4WO8KlPLBkUtDJPMQVEH7Hg+E9S0RLGujge7Z6FHMzk=;
 b=ne1GMPucB6B/fSM5LYxI8c29II14XEt8wE8unaE3yVIW07ppN552N+V2f+vEkQpFqFR/EIZfhut604mmiHx03RicVh+gaAMU+4W9PLMKMkWK6eslBO7MVVQel9RZO0xnqDTiRtB7mXgqjj9V+cvpIKlSWXiWEG3D25IQTLWJyBjkrTFQ0CzfTge+WLj7ZLY/hQFCTADfFdYt9X3o190RDPylPfi7UAi8Yi30V57gAh6rpV8imJFIW+rU0Ij4iOuTKf9mdO/tqwGz/YeCPYsbjCo9rgGSVWeQlebnTeciV50GQia08/38wZlCANi79tOyoGH0Go7HhIT1VuQv/0zcjg==
Received: from BN7PR08MB5571.namprd08.prod.outlook.com (2603:10b6:408:3d::26)
 by BN7PR08MB4435.namprd08.prod.outlook.com (2603:10b6:406:f1::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.17; Wed, 15 Dec
 2021 20:39:04 +0000
Received: from BN7PR08MB5571.namprd08.prod.outlook.com
 ([fe80::89e8:b704:e362:74a3]) by BN7PR08MB5571.namprd08.prod.outlook.com
 ([fe80::89e8:b704:e362:74a3%3]) with mapi id 15.20.4778.018; Wed, 15 Dec 2021
 20:39:04 +0000
From: Mike Marchywka <marchywka@HIDDEN>
To: "bug-coreutils@HIDDEN" <bug-coreutils@HIDDEN>
Subject: wanted to add option to date command to handle pure numeric input in
 varying ways and output for invalid dates 
Thread-Topic: wanted to add option to date command to handle pure numeric
 input in varying ways and output for invalid dates 
Thread-Index: AQHX8fPMhndG5Ke4MUuKs6qvFhRRKg==
Date: Wed, 15 Dec 2021 20:39:04 +0000
Message-ID: <BN7PR08MB55717506A5B39838E986288BBE769@HIDDEN>
References: <BN7PR08MB5571CCE76CB62D8DD9A31CCEBE769@HIDDEN>
In-Reply-To: <BN7PR08MB5571CCE76CB62D8DD9A31CCEBE769@HIDDEN>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
suggested_attachment_session_id: cc4b3764-b2f7-ba5e-ff9b-ddcbd79ae05f
x-ms-exchange-messagesentrepresentingtype: 1
x-tmn: [nbbEWNqPErXDQ6oEbnaZBucmhZzitzIj]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: a86bc55b-7823-45da-4ae5-08d9c00aef37
x-ms-traffictypediagnostic: BN7PR08MB4435:EE_
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: DUftMnFC7Qk584sjBe8iYl1E/WHgZRN3bhI1Op3y5v4xAXDwY81nCmP6BddbvYmVFsLvedIJJGSooJnHANmfsyBoq6O098XeCtjaxBgp2omWatIdnGtO/s2rNsdEp1kRx2j8xrd6QC9U2UFcTXChdPIEcraQay/bYonSOHsAUpegae2SfdRcU8avDO393zcM9vUWpS0JnUyRksxN5SyEETfahbMcOcJNBfU+Vo1IcwdxgpkVuT3AHiAifR0TPZfKpGaOobSsk3oAflufRDcc+woXnFYv7M0KUO2IDuZlsFg7SLF/7D5PEvZB5GY2HUqfLD/1CQra5sDYGp2YKYex2K0BZZMuktKgvlcvoR2pkWmm6Ac6qMwR4XYO4LKJCPYCRqelJCDtHg6hJEgdUGuoLUiapeOQ12SBAYi4iJPB1moiDn6pCSnvOLp1EBZgXso02NkgsUN3k/HoRgtJjHOOBLEg7EYTePyr+KLXsTocbCNfdSBE++l2I0wkalDeamxCbPOAvaUgNSkADeOvpRf9dKrZvp0GTD7+j1Cxao5/XhuuBP1rpM9wc0o+z0JinlFv3vRKKRy7/JD+nWjSSjU8Ig==
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: UIg0p7mWlEb3ARA9Cn1++rPbiJO1ao9eBOyHylNwGqufKYFOBVfgaM9mACizdBY8/W2sNPcBRLEv4S0ARmZWcZgAGAfsz6CbIJKKYiZa+ER7pDAcjZh01+GHyuQFS39+nMQkad6UdfVzxZn1LgqtPktJbmM4uQYJEoz/aQ/a7P5m0mPeIeAR/AwskcxThP+ie+2gu8YcDib3PcVHNS79f7GRFC501KkhwgsfHwY8LIneGY7p2CRNmf7K1UKFD8QPN8Oq2TrkypXMVMFo8/cnjnrdV998r6v823wKY+tGumDEuMn47t2uvjQhbC3gtXVkTd6RZGtHE6Go01cBevRGIpAoqNJP9OZ2vjcYWllZRu34iRGq/lEhOm11PJh7IcQS6MtLRj2aRitRiNX0iuzrkw/N2LCRzDf0Fh1lwzYPg5VCU0xqtDIa8tCU/DT8eE2PO5eS9WIxHXqYkRCjIAR745z6B+xffExwTaYAkUOuag4AIdANHdTF4838TrRZZlnTUwidd0XLZalSnX/CE2Hj6ogrrtZf3Q+F+Arh+ASyA2RCSQ5TQWHR3A5TEuwN/revVa3V871mdtRiYnfM8HBkdbMkat4j0niN7lQKm+ydctnl1YN4cok1CPRlG4DJeGooRLZ89ifWXiV0Jd2K/FTTi7x5dtod3ptABs7zRz5/dor5OqAEg1BB0PqL1tzmpJb3WwBCmGn5oKP1SIaVXp+DqSSyqQhusQrNR2Hp9JtC7tNWg++35BPewX7iK+l/UTs9iS7VbnAd1ebk5zJXQNHtRAnKA8al2b74+UfAiNZKB0kvbKn5kQ4byDOp3mNbRbYzBiBlY7hEzz7iz0jAR/GhIe863rFVs0pC8n//+Or7KqyOjgaAiMFYB4pNiPynurjghiwOD+AFUCk3aw28c/zux2oaw2BnKIxaJsXRjrtO1VtFxd9FaI9aI6GHT8dR1Kjf
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-c65ed.templateTenant
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BN7PR08MB5571.namprd08.prod.outlook.com
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-CrossTenant-Network-Message-Id: a86bc55b-7823-45da-4ae5-08d9c00aef37
X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2021 20:39:04.4930 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR08MB4435
Received-SPF: pass client-ip=40.92.19.89; envelope-from=marchywka@HIDDEN;
 helo=NAM11-DM6-obe.outbound.protection.outlook.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Wed, 15 Dec 2021 16:57:28 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
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: -2.3 (--)

I'm trying to implement the options shown below. I downloaded the coreutils=
 source=0A=
for my distro and don't expect a problem compling and implementing it.=0A=
However, is there any interest in adding similar functions to the main code=
?=0A=
=0A=
I would imagine something like,=0A=
=0A=
date  --option=3Dfour-digits-are-YYYY,invalid-output-blank-line =0A=
=0A=
My immediate concern is getting this to take the input as a year rather tha=
n HHMM and=0A=
it would be easier to make date more versatile than put logic around it,=0A=
=0A=
$echo 2000 | date +%Y -f-=0A=
2021=0A=
=0A=
not sure if anyone else would want that.=0A=
=0A=
Thanks. =0A=
=0A=
=0A=
=0A=
=A0Mike Marchywka=A0=0A=
306 Charles Cox Drive=A0=0A=
Canton, GA 30115=0A=
470-758-0799=0A=
404-788-1216=A0=0A=
=0A=
=0A=
=0A=
=0A=
________________________________________=0A=
From: Mike Marchywka=0A=
Sent: Wednesday, December 15, 2021 2:08 PM=0A=
To: coordinator@HIDDEN=0A=
Subject: the ubuntu "date" command info pointed me to you, question on modi=
fication=0A=
=0A=
I wanted to add an option to the linux date command to=0A=
deal with pure number date stings - allowing for a 4 digit number=0A=
to be a year instead of HHMM - which should be easy=0A=
for me to do but I wanted to see how it integrates.=0A=
Also, I wanted an output option, that I could write, to=0A=
send an invalid message to stdout instead of stderr.=0A=
=0A=
How should I proceed?=0A=
=0A=
Thanks.=0A=
=0A=
=0A=
 Mike Marchywka=0A=
306 Charles Cox Drive=0A=
Canton, GA 30115=0A=
470-758-0799=0A=
404-788-1216=0A=
=0A=
=0A=




Acknowledgement sent to Mike Marchywka <marchywka@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#52525; 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: Wed, 15 Dec 2021 22:15:01 UTC

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