Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Always save first N bytes of output from all commands?
- X-seq: zsh-users 23830
- From: Francisco Borges <francisco.borges@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Always save first N bytes of output from all commands?
- Date: Tue, 8 Jan 2019 15:53:40 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=0RkWnxs7yYEZZ5dApeMG8ZCVDLsOpN4g7iJhMY+XxaU=; b=AdInZFSn6Nt5zPobGtzEQ1ZJvxyXswb6wg2UqO4kMz2M0Dp9XqAV3lfZLjqIZqdPzJ WfvTIF+GHhZcUCgIlg817kM9iS3/gUV9kPe2kI6MlLRsZRMMvL/4rtBa8IS9hGXubsnF tIDQkAU4Aqn/wHrFksNxjPoZapcoqhIkoBRgZ7HhHskCADVoLZ6p4mbkP4H+zTTeYbRf d4tNuFb9sLm/+S83+fltGE38qS8ibJECAjPuLwDtcXtKvPmwLymbuooYL2Q3T47qXF7t jtJQozpT/K6b+VH7uvgkNRsr+JXKCYFun/nht3XE4WBrWMr//iWz6X+kNzDn0q7udpge t33Q==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hi,
Is there an easy easy way to *always* save the (first N bytes) of the
output all commands? Or least save the output of the very last command?
Something like always having
| tee ~/.output_history/$TTY/${HISTCMD}.out
but ideally with a control over the number of bytes written. Is something
like that possible?
Right now I resort to insert-last-command-output function (original by pws
at http://www.zsh.org/mla/users/2005/msg00550.html while answering a
question of mine...). To re-execute a command and insert its output in the
command line. Sometimes it is fast enough and sometimes it is slow. I know
we have "keep" (./share/zsh/functions/keeper) distributed with Zsh itself,
but keep much like tee has to be manually inserted into the command itself
and that it becomes less awesome.
I work on OSX and I bet I can write AppleScript code to... somehow fetch
the output and insert in the buffer but it I'd rather a (portable)
Zsh-based solution.
Any ideas other than going the AppleScript route?
--
Francisco
Messages sorted by:
Reverse Date,
Date,
Thread,
Author