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

Re: Prevent a specific function from being xtrace'd



On Mon, Aug 23, 2021 at 4:23 PM Zach Riggle <zachriggle@xxxxxxxxx> wrote:
>
> >>> local first_line=$(head -1 <<<$ZSH_DEBUG_CMD)
> > Egad.
> > local first_line=${ZSH_DEBUG_CMD%%$'\n'*}
>
> That's (almost!) the following line!  I couldn't quite get it to work,
> looks like I was missing a $ and the *.

You can also do

local first_line=${${(f)ZSH_DEBUG_CMD}[1]}

if that seems more appealing.




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