[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



[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
&gt; &gt;<a  rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale";>http://www.ale.org/mailman/listinfo/ale</a>
&gt; &gt;
&gt; &gt;  
&gt; &gt;
&gt; 
&gt; _______________________________________________
&gt; Ale mailing list
&gt; Ale at ale.org
&gt; <a  rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale";>http://www.ale.org/mailman/listinfo/ale</a>



</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00429" href="msg00429.html">[ale] Bash history</a></strong>
<ul><li><em>From:</em> meuon at geeklabs.com (Mike Harrison)</li></ul></li>
<li><strong><a name="00435" href="msg00435.html">[ale] Bash history</a></strong>
<ul><li><em>From:</em> stillwaxin at gmail.com (Michael Still)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00426" href="msg00426.html">[ale] Bash history</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
<li><strong><a name="00427" href="msg00427.html">[ale] Bash history</a></strong>
<ul><li><em>From:</em> smeadspam100 at speedfactory.net (W. Keith Miller)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00427.html">[ale] Bash history</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00429.html">[ale] Bash history</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00427.html">[ale] Bash history</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00429.html">[ale] Bash history</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00428"><strong>Date</strong></a></li>
<li><a href="threads.html#00428"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>