Skip to content

Instantly share code, notes, and snippets.

@mstssk
Last active August 29, 2015 14:06
Show Gist options
  • Save mstssk/0afa941baa757565a5b6 to your computer and use it in GitHub Desktop.
Save mstssk/0afa941baa757565a5b6 to your computer and use it in GitHub Desktop.
alias gti=~/.gti.sh
#!sh
# Re-concatenate command. Care quoted arguments.
command="git"
while [ "$1" != "" ]
do
space_contain=`echo $1 | grep "\s"`
if [ "" != "$space_contain" ]
then
command="$command \"$1\""
else
command="$command $1"
fi
shift 1
done
# Run
echo "Typo! Run following command? [Y/n]"
echo $command
read ans
case $ans in Y|y|'')
eval $command
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment