zsh-users
 help / color / mirror / code / Atom feed
* append to history entry?
@ 2016-12-26 23:16 Ray Andrews
  2016-12-27  1:28 ` Ray Andrews
       [not found] ` <5288b537-f06a-d18a-60ea-1f962856c80c__41345.3811700039$1482803962$gmane$org@eastlink.ca>
  0 siblings, 2 replies; 21+ messages in thread
From: Ray Andrews @ 2016-12-26 23:16 UTC (permalink / raw)
  To: Zsh Users

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

... which installs that package. But, I tend to install things in backup 
clones of my install so that if the package screws things up royally, 
which happens far too often, I can just back out of the clone and 
restore it to a previous condition and no harm has been done.  But, 
there can be situations where I've installed something I want to keep to 
one of these clones, and I can forget what has been installed where. For 
example here's just a few days mucking things up:

18270  rap ,F libapt-pkg.so.4.12
18272  rap ,F libapt-pkg.so
18290  rap ,N regex*
18291  rap ,I regexxer
18296  rap ,N draftsight
18369  rap ,I xdg-utils
18370  rap ,I libaudio2
18386  rap ,N epiphany
18388  rap ,I epiphany-browser
18390  rap ,N dosemu
18391  rap ,I dosemu
18462  rap ,I librecad
18472  rap ,F libicuuc
18473  rap ,I libicu57
18474  rap ,R libreoffice
18475  rap ,I libreoffice
18482  rap ,N pptview

... now, 'draftsight' made a shambles of the clone, but stuff before and 
after that might have gone to different clones so if it were possible to 
have the above lines (as retrieved from history) somehow stored with 
'$HOST' appended to them automatically (my $HOST always being the name 
of the clone I'm running) it would look something like this:

18296  rap ,N draftsight HP-b6--9-Debian2

... which would let me know that I installed draftsight to clone #2 on 
partition 6 of disk 'b' on machine 'HP'.

So I'm asking for the variable '$HOST' to be added to the command before 
it is appended to history.  Doable?


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2016-12-29  3:27 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-26 23:16 append to history entry? Ray Andrews
2016-12-27  1:28 ` Ray Andrews
2016-12-27  4:47   ` Bart Schaefer
     [not found] ` <5288b537-f06a-d18a-60ea-1f962856c80c__41345.3811700039$1482803962$gmane$org@eastlink.ca>
2016-12-27 12:55   ` Daniel Shahaf
2016-12-27 16:00     ` Bart Schaefer
2016-12-27 18:23       ` Ray Andrews
2016-12-27 19:09         ` Bart Schaefer
2016-12-27 23:16           ` Ray Andrews
2016-12-27 23:55             ` Bart Schaefer
2016-12-28  0:57               ` Ray Andrews
2016-12-28  6:04                 ` Bart Schaefer
2016-12-28 17:39                   ` Ray Andrews
2016-12-28 18:22                     ` Bart Schaefer
2016-12-28 19:20                       ` Ray Andrews
2016-12-28 21:24                         ` Ray Andrews
     [not found]                         ` <3b8fe027-d7fb-25fb-bc05-9ecd3a91b08f__38422.8622112007$1482960347$gmane$org@eastlink.ca>
2016-12-28 23:34                           ` Daniel Shahaf
2016-12-29  0:51                             ` Bart Schaefer
2016-12-29  3:27                             ` Ray Andrews
     [not found]               ` <f87d7f79-3529-d832-eed5-83d4130ea128__16005.139592062$1482888562$gmane$org@eastlink.ca>
2016-12-28  5:28                 ` Daniel Shahaf
2016-12-28  6:31                   ` Bart Schaefer
2016-12-28 16:33                   ` Ray Andrews

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).