Last active
August 29, 2015 14:06
-
-
Save mstssk/0afa941baa757565a5b6 to your computer and use it in GitHub Desktop.
alias gti=~/.gti.sh
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
#!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