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

Re: Function names prefixed with "%"



Unfortunately that kills the utility of the prefix :(

On Thu, May 26, 2022 at 8:36 PM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
On 5/27/22, Zach Riggle <zachriggle@xxxxxxxxx> wrote:
> It seems that it's completely valid to declare a function with a leading
> percent, but it's not able to be called due to be interpreted as job
> control.
>
>     $ %paste() { echo hi }
>
>     $ declare -f '%paste'
>     %paste () {
>         echo hi
>     }
>
>     $ %paste
>     fg: job not found: paste
>
> Is there any way around this behavior?  I've found that this can be worked
> around with aliases...
>
> alias '%p=%paste'
>
>
> But I expect there are other / better ways.

\%paste

--
Mikael Magnusson
--

Zach Riggle



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