Answer by Ciro Santilli 新疆改造中心法轮功六四事件 for How to execute consecutive commands...
fc for loop and xsel This works well when I want to concatenate and re-run the last n commands multiple times: fcn() ( from="${1:-2}" to="${2:-1}" if [ "$from" -ne "$to" ]; then for i in `seq "$from"...
View ArticleAnswer by user1543542 for How to execute consecutive commands from history?
To execute the commands immediately rather than edit them, here is a syntactically slimmer version of Giles answer using eval: fc -e: 432 435 The colon argument to -e is the bash noop, which has the...
View ArticleAnswer by Cyril Chaboisseau for How to execute consecutive commands from...
There is a nice and alternate way to run a number of commands in sequence from the Bash history: instead of using history substitute (!432 or !-4), you can search through the history with Ctrl+r, and...
View ArticleAnswer by Gilles for How to execute consecutive commands from history?
To view a range of commands in the history use the built-in fc command: fc -ln 432 435 To execute them again: eval "$(fc -ln 432 435)"
View ArticleAnswer by rozcietrzewiacz for How to execute consecutive commands from history?
If it refers to commands run just recently, a more efficient way is to reference them with negative numbers: !-4; !-3; !-2; !-1 Also, once you do it, your last history entry will contain the whole...
View ArticleHow to execute consecutive commands from history?
Suppose I want to execute a sequence of four commands that I have executed before. If the first one is 432 in the command-history, then I could do: $ !432; !433; !434; !435 I'm curious, is there a...
View ArticleAnswer by Pnx Rujiphan for How to execute consecutive commands from history?
fcn 3 1 >cmds.shvi cmds.shbash cmds.shbash c
View Article