Use Ctrl-R to perform an incremental search on bash history. Press Ctrl-R again repeatedly to scroll backwards through matching commands.
http://www.tahttp://www.blogger.com/img/blank.giflug.org/events/20030709/cmdline_history.html
http://superuser.com/questions/7414/how-can-i-search-the-bash-history-and-rerun-a-command
Showing posts with label shell. Show all posts
Showing posts with label shell. Show all posts
Wednesday, May 11, 2011
Monday, May 9, 2011
Line continuations and && in DOS
Notes to myself:
Here's an example
References
Multiple Commands in Single Line
DOS IF command
- && works in DOS too (only do step 2 if step 1 succeeded)
- Use ^ for line continuation
- Use %ERRORLEVEL%, labels, and goto, for some primitive flow control.
Here's an example
@echo off
set basedir=Z:\path\to\dir
cd %basedir% && ^
hg fetch -R .\MRA && ^
hg fetch -R ".\Super common" && ^
hg fetch -R .\ServerKpf
goto answer%ERRORLEVEL%
:answer0
echo hg fetch complete
komodo "%basedir%\ServerKpf\dev_util_nds_dev.kpf"
goto end
:answer1
echo Program had return code 1
pause
goto end
:end
References
Multiple Commands in Single Line
DOS IF command
Subscribe to:
Posts (Atom)