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