Skip to content

Instantly share code, notes, and snippets.

@MichaelDimmitt
Created November 14, 2023 21:45
Show Gist options
  • Save MichaelDimmitt/79986840266e7177f253c305152e0796 to your computer and use it in GitHub Desktop.
Save MichaelDimmitt/79986840266e7177f253c305152e0796 to your computer and use it in GitHub Desktop.
RLWRAP
# Basic usage: Tell iex to write all history to
# rlwrap -a iex # --always-readline
# Full working script:
# Increment the file name with the session pattern. based on what files currently exist:
rlwrapVersion=$(ls $HOME/.$filePrefix* | wc -l | awk '{print 0$1 + 1}');
# This is the path we will be writing to:
rlwrapTempPath="$HOME"/."$filePrefix"_"$rlwrapVersion"_history;
echo $rlwrapTempPath;
# Run rlwrap on iex with appropriate commands:
filePrefix=iex; rlwrap -a --history-filename="$rlwrapTempPath" "$filePrefix";
# Check after the session that everything worked:
# vi "$rlwrapTempPath";
# Other cleanup commands
echo $HOME/.iex_*
ls $HOME/.iex_*
rm -rf $HOME/.iex_*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment