• Re: Maximum size .bash_aliases file

    From Greg Wooledge@21:1/5 to Keith Bainbridge on Sun Jun 16 16:00:01 2024
    On Sun, Jun 16, 2024 at 06:13:36PM +1000, Keith Bainbridge wrote:
    Environment Variables: Bash has a limit on the number of environment variables it can store, which is typically around 32,000. If you define too many aliases, you may exceed this limit, causing issues with your shell.

    This is not strictly true. There is no limit imposed by bash; but
    there is a limit imposed by the *kernel* on the total size of the
    environment plus the argv[] argument vector passed to a process.

    <https://www.in-ulm.de/~mascheck/various/argmax/> documents this
    extremely thoroughly.

    In most cases, when a problem arises with hitting this limit, it's
    because the argument list is too long, not the environment. You seem
    to be hitting it from the other direction, though.

    Solution: "don't do that".

    Shell Scripting: Bash scripts have a limit on the number of commands
    they can execute, which is typically around 64,000.

    Well... that sounds like you're filling up the table of exit statuses
    that have been reaped internally. I think there might have been some
    bugs in older versions of bash concerning this issue as well.

    Some people have reported this issue when they run an infinite loop with
    an external command inside it (e.g. sleep).

    I don't recall off the top of my head how to work around this issue, if
    you're writing "daemon scripts" that run forever and spawn external
    commands within a loop. You might need to Google it. It's a bit
    esoteric.

    If you define too many
    aliases, you may exceed this limit, causing issues with your shell scripts.

    Huh? I have no idea what this means. Bash doesn't have a limit on the
    number of aliases you can define, as far as I know.

    Aliases do not work in shell scripts, by default. You would have to turn
    them on with a shopt. I recommend not doing that. They're disabled
    because they suck. Use functions instead of aliases, when writing scripts. They're far more sensible and flexible.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Wright@21:1/5 to Keith Bainbridge on Mon Jun 17 06:40:01 2024
    Just some random thoughts:

    On Sun 16 Jun 2024 at 18:13:36 (+1000), Keith Bainbridge wrote:

    Some of my aliases stopped working after months of working as I
    expected. And udating the .bash_aliases kept giving me an error
    referring to an end of file before the matching ' in one of the last
    aliases. So I did some searching.

    All the aliases that lie textually after the one with the missing '
    will remain undefined, so you can use bisection to locate where in
    the file problem lies.

    So, is an alias a form of variable? I had about 150 plus 4 functions

    There's little chance of hitting bash's limits unless you're
    generating the aliases or functions programmatically, and they'd
    need naming systematically for you to be able to remember them all.

    So I re-did my .bash_aliases file with only the bits I NEED; and all
    is back to normal.

    It looks like the error was in something that you judged you didn't need,
    and you removed it.

    When I got my aliases working, I checked the size of the old file -
    17K. The new .bash_aliases is 2.5K with .bash_functions at 490B.

    In any case, the bash limits you quoted were concerned with the number
    of definitions, not the size of the files containing them.

    Interesting that your aliases are on average as big as your functions.
    About 90 of my aliases occupy 3.5k, whereas ~350 functions occupy 240k,
    so averaging around 40 and 680 characters each, respectively.

    The errant function that failed after a little satisfactory use was to
    mount a USB and back it up to my system. It is used to run portable
    apps at a volunteer job - yes windows. I noticed that the sample
    functions on the web didn't have && for each line, so I removed them
    and performance is now back to what I expected. The errant line was
    the mount cmd. Originally if I had already mounted the USB, the
    function kept going. I don't recall adding the &&, so it didn't dawn
    on me to try removing them. (I worked around it by unmounting it (an
    alias) and trying the back-up again.)

    I don't follow what this is about, particularly each line having (or
    not having) a &&.

    Cheers,
    David.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From tomas@tuxteam.de@21:1/5 to Keith Bainbridge on Mon Jun 17 11:20:01 2024
    On Mon, Jun 17, 2024 at 06:47:41PM +1000, Keith Bainbridge wrote:

    On 17/6/24 14:20, David Wright wrote:
    Just some random thoughts:

    On Sun 16 Jun 2024 at 18:13:36 (+1000), Keith Bainbridge wrote:

    [...]

    All the aliases that lie textually after the one with the missing '
    will remain undefined, so you can use bisection to locate where in
    the file problem lies.


    If I didn't use a syntax matching editor this may have easily been my problem.

    I'm still pretty convinced that you're looking at a syntax problem.

    Shell syntax is... not always trivial. I wouldn't trust most text editors
    100% on that.

    One thing you might try is to run your file through "bash -n" which checks syntax without executing (well: it tries to: with languages like shell,
    this is actually practically impossible).

    Another thing would be to share your whole script here, but then you'll
    want to make sure that there's nothing in there you want to consider confidential.

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZm/+owAKCRAFyCz1etHa RtpEAJ9wHRnrGWomSTrfIjGP8cLnaob4GQCeNrcKw738pouDTZ83XoHcWNiRNJI=
    =jnQh
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gene heskett@21:1/5 to Keith Bainbridge on Mon Jun 17 13:00:07 2024
    On 6/17/24 04:26, Keith Bainbridge wrote:

    On 16/6/24 23:50, Greg Wooledge wrote:
    On Sun, Jun 16, 2024 at 06:13:36PM +1000, Keith Bainbridge wrote:

    It was late afternoon on 16Jun2024 that I wrote this. Possibly 18:13:36
    when I pressed send. I'd reckon it would likely have been 08:13:36 UTC
     What's wrong with my system clock. I've not really looked at the time
    on my originals before.  I'll try to remember to enter my local time as
    I press send

    You are not running an ntp client? I do, and in turn I am a stratum 2
    server for most of my other machines here. So my system is withing a millisecond of the atomic clocks in Colorado Springs. It's no big deal.
    use ntpsec if up 24/7, or chrony if you shut down. ntpsec works if
    already in time but can't slam to the correct time if not synchronized,
    chrony can sync after long downtimes.

    Cheers, Gene Heskett, CET.
    --
    "There are four boxes to be used in defense of liberty:
    soap, ballot, jury, and ammo. Please use in that order."
    -Ed Howdershelt (Author, 1940)
    If we desire respect for the law, we must first make the law respectable.
    - Louis D. Brandeis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Keith Bainbridge on Mon Jun 17 13:30:02 2024
    On Mon, Jun 17, 2024 at 06:47:41PM +1000, Keith Bainbridge wrote:
    On 17/6/24 14:20, David Wright wrote:
    All the aliases that lie textually after the one with the missing '
    will remain undefined, so you can use bisection to locate where in
    the file problem lies.

    If I didn't use a syntax matching editor this may have easily been my problem.

    Those aren't trustworthy with shell syntax. Shell syntax is an
    absolute nightmare, and *nothing* implements it correctly except the
    shell itself, and even then there are often bugs.

    This is the line that was being reported as the incomplete alias, and a few that follow it:


    alias srb='source /home/keith/.bashrc'
    #alias srz='source ~/.zshrc'

    The error is probably somewhere else.

    Do you still *have* the file which contains the error?
    Does it still *produce* the error message if you source it?
    If so: source the file, and *show us* the error. The whole thing.

    And then if you want anyone to help you look for the error, you'll
    have to provide a way for us to see your file. Either by attaching
    it here (if it's small enough!), or by uploading it to a web server
    and providing a URL that lets us download it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From tomas@tuxteam.de@21:1/5 to Keith Bainbridge on Mon Jun 17 14:20:02 2024
    On Mon, Jun 17, 2024 at 10:00:49PM +1000, Keith Bainbridge wrote:

    [...]

    Good evening Tomas

    [...]

    BUT how do we know where to look if the error is reported several lines
    above it's true position - admittedly blank lines; but?

    Seems you got it sorted out. Congrats :-)

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZnApJQAKCRAFyCz1etHa Rpj6AJ96jsVpVKEp1FuboJG+PwzvhOq3ywCdHYjxgH/emd/gg1MMHDYcUQPLXeY=
    =SaeF
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to David Wright on Mon Jun 17 16:30:01 2024
    On Mon, Jun 17, 2024 at 09:14:38AM -0500, David Wright wrote:
    You asked after your /system/ clock. I don't think I can tell whether
    it's set to UTC or Local Time, but only that it is correct, whichever
    it it on. Likewise the hardware RTC. The third line of /etc/adjtime
    says what the RTC is on; /etc/timezone says what the system is on;
    $ date says what your user is on.

    /etc/timezone is only used by some legacy programs. All the current
    ones should be using /etc/localtime instead, which is a symlink to a
    binary zoneinfo file, rather than a text file containing a timezone name.

    I wonder if Keith's confusion is simply due to my MUA using "AM" and "PM"
    in its attribution line, and Keith not seeing the "PM". Maybe I should
    look into configuring that differently.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Wright@21:1/5 to Keith Bainbridge on Mon Jun 17 16:20:01 2024
    On Mon 17 Jun 2024 at 18:26:19 (+1000), Keith Bainbridge wrote:
    On 16/6/24 23:50, Greg Wooledge wrote:
    On Sun, Jun 16, 2024 at 06:13:36PM +1000, Keith Bainbridge wrote:

    It was late afternoon on 16Jun2024 that I wrote this. Possibly
    18:13:36 when I pressed send. I'd reckon it would likely have been
    08:13:36 UTC What's wrong with my system clock. I've not really
    looked at the time on my originals before. I'll try to remember to
    enter my local time as I press send

    All the mail clients I've used apply the timestamp when you press
    Send. You live in eastern Australia, I assume, and if you observe
    DST at all, it won't be now.

    Your attribution could benefit from having some indication of the
    timezone that /it/ uses: Greg was writing in the morning, not near
    midnight. But your clock is OK, as shown by the headers in your
    postings:

    sending: Date: Sun, 16 Jun 2024 18:13:36 +1000
    processing: Received: from mail-oi1-x233.google.com …
    by bendel.debian.org …
    Sun, 16 Jun 2024 08:13:48 +0000 (UTC)

    You asked after your /system/ clock. I don't think I can tell whether
    it's set to UTC or Local Time, but only that it is correct, whichever
    it it on. Likewise the hardware RTC. The third line of /etc/adjtime
    says what the RTC is on; /etc/timezone says what the system is on;
    $ date says what your user is on.

    I hope this and my several other responses find you bright and bubbly
    on a Monday morning. I'm home from a day of cryptic crossword class,
    and minding 2 month old grand daughter etc. I hope my responses aren't
    too short.

    the time is 17Jun2024@18:25:58

    keithrbau@gmail.com
    keith.bainbridge.3216@gmail.com
    +61 (0)447 667 468

    UTC + 10:00

    Looks fine to me. Mobile numbers are a separate sequence like in the
    UK, aren't they, and unlike in the US.

    Cheers,
    David.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Wright@21:1/5 to Keith Bainbridge on Mon Jun 17 17:50:01 2024
    On Mon 17 Jun 2024 at 18:47:41 (+1000), Keith Bainbridge wrote:
    On 17/6/24 14:20, David Wright wrote:
    On Sun 16 Jun 2024 at 18:13:36 (+1000), Keith Bainbridge wrote:

    Some of my aliases stopped working after months of working as I
    expected. And udating the .bash_aliases kept giving me an error
    referring to an end of file before the matching ' in one of the last aliases. So I did some searching.

    All the aliases that lie textually after the one with the missing '
    will remain undefined, so you can use bisection to locate where in
    the file problem lies.

    If I didn't use a syntax matching editor this may have easily been my problem.

    This is the line that was being reported as the incomplete alias, and
    a few that follow it:

    Once you open, and don't close, a quote, then bash is likely to try
    to "bend" everything to suit, as it parses more lines. Frequently
    it will only give up at the end of the file. So any reported line
    number is likely to be meaningless.

    That's why I recommended you source the file from a clean bash shell
    and check which alias definitions have become defined, and which
    haven't. Those that get "eaten up" in the runaway quote will not
    get defined.

    There's little chance of hitting bash's limits unless you're
    generating the aliases or functions programmatically, and they'd
    need naming systematically for you to be able to remember them all.

    As I said to Greg - I don't understand this; so I don't know how I
    would have done it.

    I've seen no evidence of exceeding a limit of aliases or functions.

    So I re-did my .bash_aliases file with only the bits I NEED; and all
    is back to normal.

    It looks like the error was in something that you judged you didn't need, and you removed it.

    No. The alias worked as soon as I activated it

    You don't say which alias, nor all that had been done up to that
    point, so that doesn't convey much information to me here. Or by
    "activating the alias", do you mean sourcing the aliases file?

    I was under the impression that you severely pruned your aliases
    file from 17000 to 2500 characters, and that the larger file had an
    unmatched ' and the smaller one didn't. It would seem reasonable
    to suppose that the unmatched ' was in the prunings, the bits
    you said you didn't need.

    In any case, the bash limits you quoted were concerned with the number
    of definitions, not the size of the files containing them.

    Interesting that your aliases are on average as big as your functions. About 90 of my aliases occupy 3.5k, whereas ~350 functions occupy 240k,
    so averaging around 40 and 680 characters each, respectively.

    To clarify the file sizes. The original 17K was about 150 aliases plus
    4 functions. The new aliases file at 2.5k is about 40 aliases plus
    several comments and blank lines. The finctions file is new yesterday
    and has 2 functions (one of them 2 short commands). I'll not likely
    get my functions much bigger - in the short term anyhow.

    Really, I was only interested in the file sizes as an indication of
    how long (and possibly complex) your aliases were.

    I don't follow what this is about, particularly each line having (or
    not having) a &&.

    The only reason I raised this matter was that I had opened saying that
    my aliases were working. I originally thought that the function was my
    first sign of a problem My ERROR. It became as aside to the question
    of env variable limits

    Fair enough. But I still don't see anything reported that would cause
    you to approach bash's limits except by, say, an accidental loop.

    Cheers,
    David.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From tomas@tuxteam.de@21:1/5 to David Wright on Mon Jun 17 18:30:01 2024
    On Mon, Jun 17, 2024 at 09:14:38AM -0500, David Wright wrote:

    [...]

    You asked after your /system/ clock. I don't think I can tell whether
    it's set to UTC or Local Time, but only that it is correct, whichever
    it it on. Likewise the hardware RTC. The third line of /etc/adjtime
    says what the RTC is on; /etc/timezone says what the system is on;
    $ date says what your user is on.

    No: /etc/timezone just says what time zone a _user_ will "get" unless
    they state otherwise. I.e. a user's default time zone.

    The "system" being "on" a timezone is something that, under Unix,
    doesn't make sense.

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZnBitgAKCRAFyCz1etHa RkT+AKCBLO6zqeDlsEv7XNcOCHm1VDEq3gCfSvkRaJHlcF5rBpHopRDOaUj6yBc=
    =eTdc
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to tomas@tuxteam.de on Mon Jun 17 19:30:02 2024
    On Mon, Jun 17, 2024 at 18:22:29 +0200, tomas@tuxteam.de wrote:
    On Mon, Jun 17, 2024 at 09:14:38AM -0500, David Wright wrote:

    [...]

    You asked after your /system/ clock. I don't think I can tell whether
    it's set to UTC or Local Time, but only that it is correct, whichever
    it it on. Likewise the hardware RTC. The third line of /etc/adjtime
    says what the RTC is on; /etc/timezone says what the system is on;
    $ date says what your user is on.

    No: /etc/timezone just says what time zone a _user_ will "get" unless
    they state otherwise. I.e. a user's default time zone.

    The "system" being "on" a timezone is something that, under Unix,
    doesn't make sense.

    Time zones are not in effect for users, either; they're in effect for processes. A given user's login session, which is a collection of
    processes, would typically all be using the same time zone, for
    consistency, but this isn't necessary. They might choose to run two
    clocks, one in their local time zone, and one in another time zone,
    where a family member lives, or where they're about to take a vacation.

    /etc/localtime points to the time zone that a process will use if it
    doesn't specify one via the TZ environment variable. And /etc/timezone
    is the legacy version of /etc/localtime.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From tomas@tuxteam.de@21:1/5 to Greg Wooledge on Mon Jun 17 19:50:01 2024
    On Mon, Jun 17, 2024 at 01:20:53PM -0400, Greg Wooledge wrote:

    [...]

    The "system" being "on" a timezone is something that, under Unix,
    doesn't make sense.

    Time zones are not in effect for users, either; they're in effect for processes [...]

    Right you are.

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZnB1CAAKCRAFyCz1etHa RjcuAJ9ipW0dLWkYxJcIiZQKscue/KgTEQCffK/QG9QO4RRHmn+xQc3n1mGbCYA=
    =wNMf
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Keith Bainbridge on Tue Jun 18 13:10:01 2024
    On Tue, Jun 18, 2024 at 18:26:39 +1000, Keith Bainbridge wrote:
    I'm back. The kitchen clock says 18:05. the sun has set. I have no reason to doubt the clock. So I'll answer Greg's questions

    What does "date" say? Paste the entire output.
      date
    Tue 18 Jun 2024 18:06:31 AEST


    What does "cat /etc/timezone" say? Paste the entire output.

    cat /etc/timezone
    Australia/Melbourne

    is as close as I can specify for my regional city

    What does "ls -l /etc/localtime" say? Paste the entire output.
    ls -l /etc/localtime
    lrwxrwxrwx 1 root root 39 Mar  4 21:00 /etc/localtime -> /usr/share/zoneinfo/Australia/Melbourne

    Have you set the TZ environment variable? If so, what did you set it to?
    Not that I'm aware of
    What time zone are you *actually* in? Like, what country, and what major city is nearest to you?

    UTC +10:00

    Australia, Geelong Our capital is Melbourne

    So, everything looks fine here.

    Greg, if there is something not right with my answer, please let me know. Again thanks greatly for your help.

    In a previous message, you thought that your system clock or your time
    zone was set wrong, because you read one of the attribution lines of
    one of my replies, and you thought it said you had sent your message
    at the wrong time.

    As it turns out, I'm fairly certain you misread the attribution line,
    which was reporting time in a 12-hour format, with "PM". You saw the
    06:... and thought it was saying you had sent your email at 6 AM, but
    you missed the "PM" at the end.

    As far as I know, it was a simple misread on your part, and nothing is
    actually wrong.

    In fact, things should be even better now, because you provoked me into
    reading about mutt's attribution and date_format variables, and changing
    the silly default format to a more sensible format. You'll note that
    this reply uses an attribution with a 24-hour format.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Keith Bainbridge on Thu Jun 20 13:20:01 2024
    On Thu, Jun 20, 2024 at 21:00:38 +1000, Keith Bainbridge wrote:
    https://manpages.debian.org/bookworm/manpages-dev/strftime.3.en.html

    is a list of place names for MANY parts of a date layout. I have set up the following code in my text substitution app:
    "%a %d%b%Y at %H:%M:%S =UTC %Z"

    Triggering that give me
    Thu 20Jun2024 at 20:51:19 =UTC +10:00

    Seems to me that if the code writers of our various MUA would add the +UTC
    to the line that prints the various dates, we'd understand what they mean better.

    Honestly, I have no idea what the =UTC part of your output is intended
    to mean, since you've got +10:00 (time zone offset specification in hours
    ahead of UTC) overriding it.

    Normally, you put either the string UTC to indicate that this date/time
    string is in UTC, or a time zone offset indicator that begins with + or -.
    Not both.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Wanderer@21:1/5 to Greg Wooledge on Thu Jun 20 13:30:04 2024
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
    On 2024-06-20 at 07:10, Greg Wooledge wrote:

    On Thu, Jun 20, 2024 at 21:00:38 +1000, Keith Bainbridge wrote:

    https://manpages.debian.org/bookworm/manpages-dev/strftime.3.en.html

    is a list of place names for MANY parts of a date layout. I have set up the >> following code in my text substitution app:
    "%a %d%b%Y at %H:%M:%S =UTC %Z"

    Triggering that give me
    Thu 20Jun2024 at 20:51:19 =UTC +10:00

    Seems to me that if the code writers of our various MUA would add the +UTC >> to the line that prints the various dates, we'd understand what they mean
    better.

    Honestly, I have no idea what the =UTC part of your output is intended
    to mean, since you've got +10:00 (time zone offset specification in hours ahead of UTC) overriding it.

    I parsed it as meaning "[date and time] is equal to UTC plus ten hours",
    or in other words, "the time specified is in the UTC+10 time-zone".
    Similarly to how I often seen Eastern Standard Time referenced as UTC-4
    (that is, UTC minus four hours).

    Normally, you put either the string UTC to indicate that this date/time string is in UTC, or a time zone offset indicator that begins with + or -. Not both.

    It may be notable that he didn't put a +- offset indicator; he put a
    format specifier which *expands to* whichever such indicator would
    correspond to the active time zone.

    --
    The Wanderer

    The reasonable man adapts himself to the world; the unreasonable one
    persists in trying to adapt the world to himself. Therefore all
    progress depends on the unreasonable man. -- George Bernard Shaw


    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCgAdFiEEJCOqsZEc2qVC44pUBKk1jTQoMmsFAmZ0EE8ACgkQBKk1jTQo Mmt5Gw//YlrsNMLPGlY1F7dk36zKYkNKTcYH2XRcMrkA5dWKAH2Osn+/2WFA9PBf fzLY8tL7EktcMndzRpC+Zdo8h7gLLV3KKjF1bxKS6bWcG2FEpsPlZP0tcWBoGWBV R6V/WOEgXymJlknLdooE+SBlFRU3E2Fh0Q8o7/s07Yqgut8TpvXJ9CqjzPq5e44W 609mO13gE+9/DYenaQG1rDggkqZBM9IXlaYBwxXt5VwetptTFDL3XEpmurm4O8tf Hr9bkQzRi3Jb7iRAVc1SFMR7JR9lM/xM1ZWySwbKHki0L0/+qAc74/kxQ91s1QIB gTSUyHr1zv4XskdB4ZAAGqlUNjvgZqd+jWWGP6elzPvkeCvKGX9lms9N7UPPdp5X kbESF9hCRKF7TziSiz7grYPeDuOnXtM7V2inw+InPykFRRUcDFG9wv9g8T3eJG1m gkLxA67o0UaxGUrN6u5o+7DropnEXCMzGjttMOp/XQFj0+KfiJL7sFN/gg6WgOBO eCVDPMtUJo5PCbMBAD5r9PieN+Hoxk95xvfIXVe94myNPQU4y44Rc4L9NxG3eBjc e62Cz6QldyuUBeRl3W3FJcGx4F+VKoE1e7+5arlQHThr+s4ka9FNHXR88xLfVBkW se5odMMzQ14tYiLeLJPOCJe/+BGL
  • From David Wright@21:1/5 to Keith Bainbridge on Fri Jun 21 06:30:02 2024
    On Thu 20 Jun 2024 at 21:00:38 (+1000), Keith Bainbridge wrote:
    On 17/6/24 18:26, Keith Bainbridge wrote:

    It was late afternoon on 16Jun2024 that I wrote this. Possibly
    18:13:36 when I pressed send. I'd reckon it would likely have been
    08:13:36 UTC  What's wrong with my system clock. I've not really
    looked at the time on my originals before.  I'll try to remember
    to enter my local time as I press send

    Thanks for those responses. [ … ]

    I reskon that they seem to indicate that the date/time in my original question are fine. the difficulty is more related to how we humans are interpreting the information we are reading.

    https://manpages.debian.org/bookworm/manpages-dev/strftime.3.en.html

    is a list of place names for MANY parts of a date layout. I have set
    up the following code in my text substitution app:
    "%a %d%b%Y at %H:%M:%S =UTC %Z"

    Triggering that give me
    Thu 20Jun2024 at 20:51:19 =UTC +10:00

    Seems to me that if the code writers of our various MUA would add the
    +UTC to the line that prints the various dates, we'd understand what
    they mean better.

    Meantime, we have to accept what we have.

    You could pronounce your time written above as:

    "It's Thu 20Jun2024 at 20:51:19 here, where clocks are UTC+10:00"

    if that's indeed your intention. But what you've done is invent
    some notation of your own, which people will likely misunderstand.

    I think it best to look up these references and follow them:

    https://en.wikipedia.org/wiki/ISO_8601
    https://www.ietf.org/rfc/rfc3339.txt

    IMHO I think that email attributions are best presented in and with
    the time zone of the sender, and not oneself.

    Cheers,
    David.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Keith Bainbridge on Sat Jun 22 16:10:01 2024
    On Sat, Jun 22, 2024 at 18:28:55 +1000, Keith Bainbridge wrote:
    And doesn't this exchange show that
    Sat 22Jun2024 at 18:27:55 +10:00

    can be interpreted in two ways?

    I can only read it one way. What other way are you thinking of?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Wright@21:1/5 to Greg Wooledge on Sat Jun 22 17:00:01 2024
    On Sat 22 Jun 2024 at 10:02:43 (-0400), Greg Wooledge wrote:
    On Sat, Jun 22, 2024 at 18:35:34 +1000, Keith Bainbridge wrote:
    On 21/6/24 14:28, David Wright wrote:
    You could pronounce your time written above as:

    "It's Thu 20Jun2024 at 20:51:19 here, where clocks are UTC+10:00"

    Excellent. Now how do we get our MUA to do that when replying to mail,

    Depends on your MUA. In mutt, it would be:

    set date_format="!It's %a %d%b%Y at %H:%M:%S here, where clocks are UTC%z"

    except that this won't put a colon inside the timezone offset. It
    would just end with "UTC+1000".

    Of course, you probably don't want that exact wording, because it's
    used as *part* of the attribution. If you used the above, then the attribution would come out looking like:

    On It's Thu 20Jun2024 at 20:51:19 here, where clocks are UTC+1000, So-and-So wrote:

    So, you'd either want to change the attribution variable as well, or
    alter that wording slightly. I'd suggest removing "It's" and "here".

    I think you need to set attribution, not date_format. For example,
    set attribution="On %{%a %d %b %Y} at %{%H:%M:%S (%z)}, %n wrote:"
    is my own. The %{…} braces indicate using the sender's time zone.

    Cheers,
    David.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Wright@21:1/5 to Keith Bainbridge on Sat Jun 22 17:10:02 2024
    On Sat 22 Jun 2024 at 18:35:34 (+1000), Keith Bainbridge wrote:
    On 21/6/24 14:28, David Wright wrote:
    You could pronounce your time written above as:

    "It's Thu 20Jun2024 at 20:51:19 here, where clocks are UTC+10:00"

    Excellent. Now how do we get our MUA to do that when replying to mail,
    which is where I saw what I thought was a system error - but in fact
    was a misinterpretation.

    I don't see the point. The email has a "Date:" header.

    Unless it's significant that your email is like a blog that's been
    written over a period of time; chronicling current events, say.

    if that's indeed your intention. But what you've done is invent
    some notation of your own, which people will likely misunderstand.

    I think it best to look up these references and follow them:

    https://en.wikipedia.org/wiki/ISO_8601
    https://www.ietf.org/rfc/rfc3339.txt

    Will do

    IMHO I think that email attributions are best presented in and with
    the time zone of the sender, and not oneself.

    Maybe that would be achieved if the replyer's MUA inserted the senders date/time more clearly. I don't mean to harp on, but maybe the
    coders just haven't mis-read the dates they are inserting for us.

    They write Date: in the same format, often called RFC822 format,
    see RFC 2822.

    Cheers,
    David.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to David Wright on Sat Jun 22 18:30:02 2024
    On Sat, Jun 22, 2024 at 09:51:32 -0500, David Wright wrote:
    On Sat 22 Jun 2024 at 10:02:43 (-0400), Greg Wooledge wrote:
    set date_format="!It's %a %d%b%Y at %H:%M:%S here, where clocks are UTC%z"

    I think you need to set attribution, not date_format. For example,
    set attribution="On %{%a %d %b %Y} at %{%H:%M:%S (%z)}, %n wrote:"
    is my own. The %{…} braces indicate using the sender's time zone.

    The default value of attribution contains %d which references the
    date_format variable. The "!" in the date_format variable says to
    use the C locale when writing the day-of-week and month abbreviations,
    rather than whatever your regular locale would call them.

    I'm using this:

    set date_format="!%a, %b %d, %Y at %H:%M:%S %z"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Wright@21:1/5 to Greg Wooledge on Sun Jun 23 06:30:01 2024
    On Sat 22 Jun 2024 at 12:26:05 (-0400), Greg Wooledge wrote:
    On Sat, Jun 22, 2024 at 09:51:32 -0500, David Wright wrote:
    On Sat 22 Jun 2024 at 10:02:43 (-0400), Greg Wooledge wrote:
    set date_format="!It's %a %d%b%Y at %H:%M:%S here, where clocks are UTC%z"

    I think you need to set attribution, not date_format. For example,
    set attribution="On %{%a %d %b %Y} at %{%H:%M:%S (%z)}, %n wrote:"
    is my own. The %{…} braces indicate using the sender's time zone.

    The default value of attribution contains %d which references the
    date_format variable. The "!" in the date_format variable says to
    use the C locale when writing the day-of-week and month abbreviations,
    rather than whatever your regular locale would call them.

    I'm using this:

    set date_format="!%a, %b %d, %Y at %H:%M:%S %z"

    I didn't mean that it won't work.

    The attribution format is designed for the benefit of recipients.
    The date_format is designed to be available for constructing
    strings like indexes and folder lists for the user, as well as
    external-facing uses. You might want to add text like "where clocks
    are" to the top of a message, but it would be tedious to have a
    column of
    where clocks are
    where clocks are
    where clocks are
    where clocks are
    in an index.

    Cheers,
    David.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Keith Bainbridge on Tue Jun 25 13:20:01 2024
    On Tue, Jun 25, 2024 at 18:35:00 +1000, Keith Bainbridge wrote:
    On 23/6/24 00:02, Greg Wooledge wrote:
    In mutt, it would be:

    set date_format="!It's %a %d%b%Y at %H:%M:%S here, where clocks are UTC%z"

    I believe UTC%Z will give the :

    as I get from my text expander.

    Tue 25Jun2024 at 18:34:20 =UTC +10:00

    Well, maybe it does. The strftime(3) documentation doesn't support
    that, though:

    %z The +hhmm or -hhmm numeric timezone (that is, the hour and
    minute offset from UTC). (SU)

    %Z The timezone name or abbreviation.

    In my experience, the "timezone name or abbreviation" is useless to
    anyone who doesn't live in or near that time zone, particularly since
    you cannot use it as the value of a TZ variable to ask date(1) what
    time it is in that time zone.

    On my system, at this time of year, it prints "EDT".

    hobbit:~$ printf '%(%z %Z)T\n' -1
    -0400 EDT

    Bash's builtin printf, when using the %(fmt)T specifier, is documented
    to call strftime(3), just like mutt's date_format. So I consider this
    a valid test, without needing to write a C program, or change my
    date_format variable.

    Here's another test:

    hobbit:~$ TZ=Australia/Eucla printf '%(%z %Z)T\n' -1
    +0845 +0845

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From debian-user@howorth.org.uk@21:1/5 to Greg Wooledge on Tue Jun 25 14:30:02 2024
    Greg Wooledge <greg@wooledge.org> wrote:
    Here's another test:

    hobbit:~$ TZ=Australia/Eucla printf '%(%z %Z)T\n' -1
    +0845 +0845

    That seems like a bug. I'd have expected:

    +0845 ACWST

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to debian-user@howorth.org.uk on Tue Jun 25 15:00:01 2024
    On Tue, Jun 25, 2024 at 13:25:10 +0100, debian-user@howorth.org.uk wrote:
    Greg Wooledge <greg@wooledge.org> wrote:
    Here's another test:

    hobbit:~$ TZ=Australia/Eucla printf '%(%z %Z)T\n' -1
    +0845 +0845

    That seems like a bug. I'd have expected:

    +0845 ACWST

    My guess is the time zone names are provided (or not provided) by libc,
    and in this case one is not being provided, so it falls back to the %z response. If this guess is correct, then you could file a bug against
    the libc6 package.

    There might be layers I don't understand. Maybe it's related to
    generated locales or something. In that case, the result would depend
    on which locales I have generated on my system.

    Do you get a different result? If so, can you explain why?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)