I have bash function that allows me to copy a line from history. Here's the function
history_cp() {
history |
sort --reverse --numeric-sort |
fzf |
awk '{ $1=""; print }' |
tr -s ' ' |
xclip -selection clipboard
}
It works fine, but fzf doesn't maintain the order of the results, how do i keep the sorted results?