blob: b4326cdaa127c04b1255dccc6498826c3262bf8c (
plain)
- #!/bin/sh
- # create slices of text
- set -e
- # resolve options
- eval set -- "$(getopt -s sh -o f -- "$@")"
- while true; do case "$1" in -f) force=1; shift;; --) shift; break;; esac; done
- . /lib/lsb/init-functions
- # actual slicing: first argument is variant, others are csplice patterns
- doit() {
- variant=$1; shift
- csplit -s -f $stem -b "-$variant-%03d.mdwn" $stem.mdwn "$@"
- }
- log_action_begin_msg "Create slices"
- for stem in "$@"; do
- log_action_cont_msg $stem
- doit rec '/^([[:digit:]]\+)\|HAS ADOPTED THIS REGULATION/' '{19}' '%%' '{*}'
- done
- log_action_end_msg $?
|