Skip to content

Instantly share code, notes, and snippets.

@apathor
Created January 29, 2020 21:50
Show Gist options
  • Save apathor/0c588bfb43bee07e4cc2167c33175e3d to your computer and use it in GitHub Desktop.
Save apathor/0c588bfb43bee07e4cc2167c33175e3d to your computer and use it in GitHub Desktop.
#; -*-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