[ale] Bash history
Christopher Fowler
cfowler at outpostsentinel.com
Wed Nov 30 07:52:42 EST 2005
683 is simply the line number in the history file. One must read their
file first or read the output of the history command to know what
command is associated with 683
[cfowler at shuttle ~]$ history | tail
991 vim ~/.bashrc
992 source ~/.bashrc
993 history | grep mkiso
994 rexec 688
995 cd cloop-2.02/
996 sudo mount -o loop ./filesystem2.img /mnt/loop0/
997 mount
998 sudo -s
999 history | grep cdrecord
1000 history | tail
[cfowler at shuttle ~]$
Say I want to redo the mount without retyping. I just want to specify
the line number in the history buffer.
I specified bash and bash can be loaded on many unix systems therefore
making this consistent.
On Wed, 2005-11-30 at 07:44 -0500, W. Keith Miller wrote:
> !683
>
> Note: this isn't always consitent across Unices.
>
>
>
>
>
> Christopher Fowler wrote:
>
> >Is there a trick to executing commands in the bash history.
> >
> ># history | grep long_command
> ># exec 683
> >
> >
> >I've written a perl script that takes the bash history as stdin and then
> >executes the command
> >
> ># history | /tmp/history.pl 683
> >
> >Works but not an elegant solution.
> >
> >_______________________________________________
> >Ale mailing list
> >Ale at ale.org
> >http://www.ale.org/mailman/listinfo/ale
> >
> >
> >
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
More information about the Ale
mailing list