Created
November 14, 2023 21:45
-
-
Save MichaelDimmitt/79986840266e7177f253c305152e0796 to your computer and use it in GitHub Desktop.
RLWRAP
This file contains hidden or 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
# 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