Skip to content

Instantly share code, notes, and snippets.

@fanzeyi
Created April 4, 2011 04:45
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 fanzeyi/901142 to your computer and use it in GitHub Desktop.
Save fanzeyi/901142 to your computer and use it in GitHub Desktop.
bash function
gcci () {
if [ "$#" -eq "0" ]
then
return
fi
cname=$(echo "$1.c")
gcc -Wall -g $cname -o $1 && time ./$1
}
new () {
if [ "$#" -eq "0" ]
then
echo Need Args
return
fi
mkdir $1
cd $1
inname=$(echo "$1.in")
echo Input Data:
cat >> $inname
echo -e 'all:\n\tgcc -Wall -g '$cname' -o '$1 >> Makefile
cname=$(echo "$1.c")
gvim $cname &> /dev/null &
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment