From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: Odd behavior with various (q) array modifiers and non-printable characters (backspace, newline)
Date: Thu, 12 Aug 2021 06:34:45 -0700 [thread overview]
Message-ID: <b4318133-5485-c720-eb8c-73bb620d1e32@eastlink.ca> (raw)
In-Reply-To: <CAH+w=7YKt1HZDPWKn_c4QgV0hpiOqJmWo9DSoYSJnQvk2S9Q0w@mail.gmail.com>
On 2021-08-11 5:22 p.m., Bart Schaefer wrote:
> On Wed, Aug 11, 2021 at 4:25 PM Zach Riggle <zachriggle@gmail.com> wrote:
>> TLDR 2: I also learned that (q+) is my new favorite, and my code
>> should use "command echo" to avoid the above behavior.
I'd like to add the anecdotal remark that there were many situations
where I thought I'd solved a problem with (q) or (Q) or (q+) and it
turned out that these things only made more trouble in the end. Better
solutions were to be found that didn't involve the Q continuum. Being
only semi-literate as I am, sometimes the mystery never did get solved
-- I had some issue, (q...) seemed the fix it, then (q...) started
breaking things, I remove the (q...) and it seems like there never was a
problem to begin with, probably because I made some other change that
obviated the original issue. If Zach's experience is like mine he
might end up being weary of the Q himself.
One of my astronomy packages creates this helpful directory and file:
4096 [2021-01-01--14:03] Sky above 49°30'N 123°30'W at Sun 2020
Dec 20 20 26_files/
22213 [2020-12-20--12:27] Sky above 49°30'N 123°30'W at Sun 2020
Dec 20 20 26.html
... and I always throw any change I make in one of my functions at those
files as torture tests because any change is likely to break when it
encounters those -- the internal quote or the special characters or the
spaces are ultra fragile and only the exactly perfect code handles all
of them at the same time. Q seemed to help at times, but again, it
often was a false friend. I'm still far from clear on how you
absolutely, perfectly protect *any* filename or string every time even
on Mondays and even if it's a filename that the Devil himself wouldn't
make ... but I get closer all the time. Zach will get the right advice
tho and not from me.
next prev parent reply other threads:[~2021-08-12 13:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-11 20:29 Zach Riggle
2021-08-11 21:16 ` Bart Schaefer
2021-08-11 21:42 ` Lawrence Velázquez
2021-08-11 23:25 ` Zach Riggle
2021-08-12 0:22 ` Bart Schaefer
2021-08-12 0:34 ` Lawrence Velázquez
2021-08-12 13:34 ` Ray Andrews [this message]
2021-08-12 0:36 ` Lawrence Velázquez
2021-08-14 15:52 ` Daniel Shahaf
2021-10-19 19:17 ` Zach Riggle
2021-10-21 14:24 ` Daniel Shahaf
2021-10-21 15:23 ` Bart Schaefer
2021-08-11 21:27 ` Bart Schaefer
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=b4318133-5485-c720-eb8c-73bb620d1e32@eastlink.ca \
--to=rayandrews@eastlink.ca \
--cc=zsh-users@zsh.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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).