-
-
Save trapier/887ac740ba0d68f9d1dab87a7d6fe253 to your computer and use it in GitHub Desktop.
bash inputrc-based replify
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
#!/bin/sh | |
if [ $# -eq 0 ] ; then | |
echo "Usage: $(basename $0) command" | |
exit 1 | |
fi | |
command=$1 | |
export INPUTRC=$(mktemp inputrcXXX) | |
export PS1="$command> " | |
cat > $INPUTRC << EOINPUTRC | |
" ": "\C-j${command} " | |
EOINPUTRC | |
bash | |
rm $INPUTRC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment