diff options
author | William Carroll <wpcarro@gmail.com> | 2016-08-15T15·14-0400 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2016-08-15T15·14-0400 |
commit | 4563550969467223f422df1eda9c15165d24607c (patch) | |
tree | cbdf9570a5ffa0176e79eff3df63690cfa443624 /functions/history_functions.sh | |
parent | 6021ad31941203dafc2abd643a98fb549b620c6a (diff) |
Trims fat and renames files
Diffstat (limited to 'functions/history_functions.sh')
-rw-r--r-- | functions/history_functions.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/functions/history_functions.sh b/functions/history_functions.sh new file mode 100644 index 000000000000..5f97884b1018 --- /dev/null +++ b/functions/history_functions.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + + +HISTFILE=~/.zsh_history + + +function wh_two_back { + command=$(history | tail -n 2 | head -n 1 | cut -c 8-) + echo -n $command +} + + +function wh_three_back { + command=$(history | tail -n 3 | head -n 1 | cut -c 8-) + echo -n "$command" +} + + +function wh_four_back { + command=$(history | tail -n 4 | head -n 1 | cut -c 8-) + echo -n "$command" +} + + +function wh_five_back { + command=$(history | tail -n 5 | head -n 1 | cut -c 8-) + echo -n "$command" +} + |