coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

date should become tolerant to superfluous and contradicting options


From: Adalbert Hanßen
Subject: date should become tolerant to superfluous and contradicting options
Date: Thu, 21 Jan 2021 16:15:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0

Hello all,

currently, the user can not properly redefine the default behavior of
date, because doing so (e.g. through alias), he prevents himself from
using another variant of the same option by stating it explicitly on a
later occasion.

Consider e.g. the case that a user wants date to produce by default what

date -Iseconds

now produces, i.e. make-Iseconds the default setting. This would most
naturally be done by setting an alias:

alias date='date -Iseconds'

e.g. to/etc/bash.bashrc. However once this is done, calling

date -Iminutes

yields an error  because the date format is stated twice. It would be
possible to unalias the alias by calling

\date -Iminutes

if one wants to let date deliver a shorter and less accurate date and
time, but this would have to be done also in every script using date on
that computer.

Other bash commands solve this problem by letting only the last option
prevail, if there are any contradictions because a given option
contradicts an earlier given one.

There is one more topic which I find no reference where it has  been
addressed before: How can a script programmer guarantee that all options
of all commands he wants to use in his script really use the default
options he is thinking about without risking any deviations by aliases?
Would it be an option to start a new bash in order to guarantee that?

Kind regards

Adalbert Hanßen


-- 
2018-07-08_Standard

*P.S.:*
1. Wenn diese Mail nicht verschlüsselt ist, fehlt mir wahrscheinlich
Ihr/_öffentlicher_/PGP/GnuPG-Schlüssel.
Wo möglich, schreibe ich normalerweise verschlüsselt. An mehrere
gleichzeitig jedochunverschlüsselt,
wenneiner dabei ist, dessen öffentlicher Schlüssel mir fehlt.

2. Wenn die Datei 0x60F8E85A6DB90BA2.asc angehängt ist, ist
der"Buchstabensalat" darin mein
öffentlicher PGP-Schlüssel. Den bittefür verschlüsselte Mails an
Adalbert.Hanssen@gmx.de verwenden.
_____________________________

Dipl.-Math. Adalbert Hanßen
Elsterweg 4
73434 Aalen

Tel: +49 7361 5280 947
Fax: +49 7361 9750 831

Attachment: 0x60F8E85A6DB90BA2.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]