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

Re: How to get 'fc' context?



On Mar 16, 12:11pm, Han Pingtian wrote:
} Subject: Re: How to get 'fc' context?
}
} On Sun, Mar 15, 2015 at 05:30:22PM -0700, Bart Schaefer wrote:
} > Try for example:
} > 
} > % fc -e '() { print echo $zsh_eval_context } >|'
} > echo toplevel fc shfunc
} > toplevel fc shfunc
} > % 
} Thanks. But what does the '>|' mean here, please?

Sorry, this example might be clearer:

    fc -e '() { print echo $zsh_eval_context >| $1 }'

"fc -e" constructs the editor command by appending a temporary file name
to the argument string and then "eval"-ing it.  So ending the string
with ">|" means to clobber that file (in the no_clobber option sense).



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