Skip to content

Instantly share code, notes, and snippets.

@iracooke
Created August 1, 2018 00:03
Show Gist options
  • Save iracooke/493f4c2b843e9f378d646e7720852ff4 to your computer and use it in GitHub Desktop.
Save iracooke/493f4c2b843e9f378d646e7720852ff4 to your computer and use it in GitHub Desktop.
BC3203 Patches
BEGIN { in_q=0 }
/^```.*question_/ {
in_q=1;
match($0,"question_[a-z]*[0-9]+")
printf("%s(){\n",substr($0,RSTART,RLENGTH));
}
/#Your answer here/ {
if (in_q){
printf("\t%s\n","echo \"answer\"")
}
next;
}
!/```/{
if (in_q){
printf("\t%s\n",$0)
}
}
/^```$/{
if (in_q){
printf("}\n")
in_q=0
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment