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

Re: append to history entry?



On 26/12/16 03:16 PM, Ray Andrews wrote:
Can I arrange for a function to append something to it's own entry into history when it is run? My function 'rap' is a wrapper around all the various 'apt' 'dpkg' and sundry Debian package managers and I might:


$ rap ,I libapt-pkg.so.4.12

This seems to work:

   alias rap=' noglob _rap'
   function _rap ()
   {

   print -S "rap $* ; echo $HOST"
   ...
   ...

Leading space keeps the command out of history as usual, then I just replace it with the massaged version. On recall:


    $ rap ,N libreoffice ; echo HP-b6--9-Debian2

... so the $HOST information is harmless on re-execution but I have my reminder as to which clone I was running at the time.

Sound?



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