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

Re: Function names prefixed with "%"



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




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