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

Re: Belaboring substitution syntax




On 2022-11-15 22:26, Bart Schaefer wrote:
"${(@)${somethingthatcreatesanarray}}".

Speak of the devil and he appears:  a guy on StackExchange just offered this for my 'keep erased lines' issue:

    remnant=( "${(@M)remnant##*$~zsh_case${searchstring[ee]}*}" )

... (name off the array was 'cc' previously) but this seems to be about approximately exactly my imaginary operator, no?  '##', which I understand, throw in the '(@M)' which is probably not that hard to understand, so unless I hear different, it seems to produce identical results to the more belabored form:

    remnant=( "${remnant[@]/#%^*$~zsh_case${searchstring[ee]}*}" )

... so thereyago.  Two operators shorter.









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