Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
append to history entry?
- X-seq: zsh-users 22282
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: append to history entry?
- Date: Mon, 26 Dec 2016 15:16:55 -0800
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author