From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9706 invoked by alias); 26 Dec 2016 23:47:07 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22282 Received: (qmail 5847 invoked from network); 26 Dec 2016 23:47:06 -0000 X-Qmail-Scanner-Diagnostics: from mta01.eastlink.ca by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(24.224.136.30):SA:0(-3.8/5.0):. Processed in 1.649437 secs); 26 Dec 2016 23:47:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: rayandrews@eastlink.ca X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.eastlink.ca designates 24.224.136.30 as permitted sender) X-Authority-Analysis: v=2.2 cv=DOfN2GFb c=1 sm=1 tr=0 a=28Ntk8jg+Dho8ABWn/CRtA==:117 a=28Ntk8jg+Dho8ABWn/CRtA==:17 a=IkcTkHD0fZMA:10 a=XmHBgPrXSyCgzmF91m4A:9 a=QEXdDO2ut3YA:10 X-EL-IP-NOAUTH: 24.207.16.108 To: Zsh Users From: Ray Andrews Subject: append to history entry? Message-id: Date: Mon, 26 Dec 2016 15:16:55 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-version: 1.0 Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit 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?