Skip to content

Instantly share code, notes, and snippets.

@trapier trapier/replify.sh Secret
Created Mar 31, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.