Created
January 29, 2020 21:50
-
-
Save apathor/0c588bfb43bee07e4cc2167c33175e3d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#; -*-shell-script-*- | |
# rleval COMMAND | |
# Eval command and write the output into readline line buffer. | |
rleval() { | |
local a="${READLINE_LINE:0:$READLINE_POINT}" | |
local b="${READLINE_LINE:$READLINE_POINT}" | |
local s; s=$(eval "$@") | |
READLINE_LINE="${a}${s}${b}" | |
let READLINE_POINT+=${#s} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment