Skip to content

Commit

Permalink
Fix bug re:adding a history entry as a macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Schinkel committed Jan 9, 2023
1 parent 758eb32 commit 9a99921
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bash-macros.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function bash_macro_add() {
bash_macros_on_error "You must specify either a command or a history number as a 2nd parameter"
fi
if [[ "${command}" =~ [0-9]+ ]] ; then
command="$(history | grep "^ ${command} " | cut -f 2- -d ' ')"
command="$(history | grep "^ ${command} " | cut -f 4- -d ' ')"
fi
echo "m${macro_num}=\"${command}\""
# shellcheck disable=SC2139
Expand Down

0 comments on commit 9a99921

Please sign in to comment.