Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: How to delete .*.~undo-tree~ files?



On Wed, Jun 12, 2024 at 11:28 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
>> On 2024-06-12 10:46, Mark J. Reed wrote:
>>
>> So .*.'~undo-tree~' is still just one string, even though only part of it is in quotation marks.  The part in quotes is not subject to glob expansion; the part not in quotes is.
>
> Pure curiosity, I have no problem to solve, but supposing you did want to break the string up, I suppose you'd have to use an array?  Then perhaps manipulate the elements/words as desired, then recombine?

I'm unclear what you mean by "break the string up".

Placing strings (quoted or not) adjacent to one another in shell is a
straight concatenation, just like separating strings with dot in perl
or plus in Javascript.  Once they're concatenated any quoting is gone
and you just have a single string with no particular rules for how to
break it up again.  You can't recover the original pieces.

So the only way to "break the string up" is never to put it together
in the first place.  Using an array would be one way to do that, but
not necessarily the best way depending on where/how the substrings
originate.




Messages sorted by: Reverse Date, Date, Thread, Author