Last active
March 27, 2016 18:59
-
-
Save j4nu5/55005626c282e056b753 to your computer and use it in GitHub Desktop.
Script to create solution and input files for USACO
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
#!/bin/bash | |
if [[ $# < 1 ]] | |
then | |
echo "Usage: ./solve.sh <PROBLEM_NAME>" | |
exit -1 | |
fi | |
PROBLEM_NAME="$1" | |
TEMPLATE_FILE="template.cpp" | |
# Clone template | |
echo "Cloning template $TEMPLATE_FILE ..." | |
cp "$TEMPLATE_FILE" "$1.cpp" | |
sed -i -- "s/TEMPLATE/$1/g" "$1.cpp" | |
echo "Template successfully cloned into $1.cpp" | |
# Create input file | |
echo "Creating input file $1.in ..." | |
touch "$1.in" | |
echo "Input file $1.in successfully created" | |
# Success! | |
echo -e "\nDone! All the best!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment