Skip to content

Instantly share code, notes, and snippets.

@trapier
Created March 31, 2017 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trapier/887ac740ba0d68f9d1dab87a7d6fe253 to your computer and use it in GitHub Desktop.
Save trapier/887ac740ba0d68f9d1dab87a7d6fe253 to your computer and use it in GitHub Desktop.
bash inputrc-based replify
#!/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