* Frank Terbeck <bts@bts.grml.org> [2008-01-22 12:48]:
> > [...]
> > Because bash seems to have a command for this. But I don't remember it.
> Bash has this? Never heard of that. Nor would I care.
,----[ IRC log #zsh - Fri Sep 21 2007 ]-
| 15:39 [dnme ]: is there something to format the history time in .history for zsh ?
| 15:39 [dnme ]: I'm switching from bash3
| 15:39 [dnme ]: and there I had somethinglike HISTTIMEFORMAT
| 15:40 [ ft ]: what did that do?
| 15:40 [dnme ]: that showed me the time of any commands in the format I chose
| 15:40 [dnme ]: for example:
| 15:40 [dnme ]: 4369 [Thu 2007/09/20 16:53:06] vim /etc/hosts
| 15:40 [dnme ]: 4370 [Thu 2007/09/20 16:55:04] cat /etc/host
| 15:40 [dnme ]: 4371 [Thu 2007/09/20 16:55:05] cat /etc/hosts
`----
> I'm not against this function at all, I'd just never use it.
Lucky me. (o;
> This obviously requires extended_history, which grml enables by
> default, so that should not be an issue.
OK. I took it for granted as well. (o;
> > einfo ${usage} ; /bin/false ; eend $?
> Personally, I dislike using these e*() function for anything else but
> system scripts. For shell functions (which basically work a lot like
> usual programs/commands) I'd prefer plain output a lot.
OK. Fine by me. I was just geared to grml's policy[1]. And
unfortunately didn't differ between scripts and functions regarding to
it.
> > fc -lE -m "*[${(L)1[1]}${(U)1[1]}]${1[2,-1]}*" ${2:-\-100} $3
> Would you mind explaining this one a bit?
> I'm not exactly familiar with the 'fc' builtin.
-l list results on stout rather than invoking $EDITOR.
-i Print dates as in YYYY-MM-DD. (-i is now used instead of -E, which is dd.mm.yyy)
-m Search for a - quoted - pattern within the history.
It's commented in the function itself as well now.
> Also, I would assign $1 etc. to named variables, which would increase
> readability.
Usually I try to avoid setting two much parameter for a simple
function. But it's fine by me to do so of course.
And _yes_, it does improve readability. (o;
---------- Footnotes ----------
[1] http://grml.org/policy -- 5.3.1. /etc/grml/lsb-functions |