Skip to content

Instantly share code, notes, and snippets.

@victorb
Forked from danielrw7/ replify
Created August 19, 2016 17:18
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 victorb/ebb8a8782721a912464921bf329f0bda to your computer and use it in GitHub Desktop.
Save victorb/ebb8a8782721a912464921bf329f0bda to your computer and use it in GitHub Desktop.
replify - Create a REPL for any command
#!/bin/sh
command="${*}"
printf "Initialized REPL for [%s]\n" "$command"
printf "%s> " "$command"
read -r input
while [ "$input" != "" ];
do
eval "$command $input"
printf "\n%s> " "$command"
read -r input
done
$ replify echo
Initialized REPL for [echo]
echo> "Hello, World!" 
Hello, World!

echo> "It works!"
It works!

$ replify git
Initialized REPL for [git]
git> init
Initialized empty Git repository in /ebs1/html/test/.git/

git> remote add origin https://your-url/repo.git                

git> checkout -b new-branch
Switched to a new branch 'new-branch'

git> push   
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment