Am 2007-11-19 14:45:35, schrieb Steve Kemp:
> On Fri Nov 16, 2007 at 22:46:22 +0100, Michelle Konzack wrote:
>
> > while read LINE
> > do
> > if [ -z "$(grep "${LINE}" ~/.bash_history.tmp)" ] ; then
> > echo -e "${LINE}" >>~/.bash_history.tmp
> > fi
> > done
>
> That is just *nasty*. For each line in the file you invoke
> a new grep...
>
> What about :
>
> sort -u < ~/.bash_history > ~/.bash_history.new
>
> Sure it re-orders entries, but in practice your current solution does
And this is exactly what I do not want.
> too. (ie. dupes removed between existing commands are going to affect
> the ordering of commands.)
I hold only the FIRST occurance of a commandline.
And yes, there is a option which add timestamps to the ~/.bash_history
file, but curently I have not try to hold the LAST occurance of a
command...
Thanks, Greetings and nice Day
Michelle Konzack
Tamay Dogan Network
Open Hardware Developer
Debian GNU/Linux Consultant
--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack Apt. 917 ICQ #328449886
50, rue de Soultz MSN LinuxMichi
0033/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com)
Attachment:
signature.pgp
Description: Digital signature