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

Re: persistance in zcalc funct defs



On Thu, 03 May 2018 03:38:01 -0700
"jdh" <dhenman@xxxxxxxxx> wrote:
> In zcalc I did the below (The constants are for 360/(2*pi) and it's
> inverse)
> 
> ..> function dtor $1 *  0.0174533
> ..> function rtod $1 * 57.2958  
> 
> 
> 
> When I shut down and reboot on the morrow, I dought that these will
> persist.
> 
> Do I need to, or can I put these functions in a zcalc read/init
> file ? This syntax will probably not work in the zsh startup files.

Just put the following in your .zshrc:


autoload -Uz zmathfuncdef
zmathfuncdef dtor '$1 *  0.0174533'
zmathfuncdef rtod '$1 * 57.2958'


See the zshcontrib manaul.

pws



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