SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Sponsored Links

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

When you use zsh as your shell, you can use setopt EXTENDED_HISTORY
to save timestamps to you commands in .zsh_history. However, the timestamps are in seconds since the epoch, and therefore not quite well readable.
This simple script will parse .zsh_history and convert timestamps to readable format. As a bonus, it will colourise the output.

You need python to run the scripts, and not much else.

Installation
copy zshistrc to /etc, or rename it to ~/.zshistrc, and modify according to your needs. Copy zshist somewhere in your path. Copy manpage to an appropriate place. That's all.
Usage
zshist without arguments will display $HOME/.zsh_history If there is an argument, and it is file, it will be displayed. If it is a directory, zshist will append .zsh_history to the argument and try to display this.
Changes
0.2 - Mon Jan 31 14:47:00 CET 2000: if an argument is a directory, append .zsh_history to it.

0.3 - Tue Feb 8 13:34:07 CET 2000: fix stupid bug mangling lines with : in them

0.4 - Wed Apr 20 15:06:10 CEST 2005: small correction by Lubomir Host <rajo @ platon.sk> -

historyfile can be now specified in configuration file

  • if argument is a single hyphen-minus -, read history file from standard input

Written by Radovan Garabik <garabik @ melkor.dnp.fmph.uniba.sk>. For new versions, look at http://melkor.dnp.fmph.uniba.sk/~garabik/zshist.html

Copyright is public domain - do whatever you want with this.

Special thanks to Milan Matos <matos @ fmph.uniba.sk> for suggesting the name of this script.


Sponsored Links

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.