Added file to extract exercises using awk.
This commit is contained in:
parent
4f7a16befb
commit
d0597244e4
1 changed files with 14 additions and 0 deletions
14
exercise.sh
Executable file
14
exercise.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Script to extract exercises from PLFA chapters, e.g., `src/plfa/part1/Naturals.lagda.md`.
|
||||
# Usage:
|
||||
#
|
||||
# ./exercise.sh [SOURCE] [TARGET]
|
||||
|
||||
SRC="$1"
|
||||
shift
|
||||
|
||||
DST="$1"
|
||||
shift
|
||||
|
||||
awk '/^#/{flag=0} /^#### Exercise/{flag=1} flag' "$SRC" > "$DST"
|
Loading…
Add table
Reference in a new issue