summaryrefslogtreecommitdiff
path: root/mkslice-2
blob: 507f0c5d8cd5b2c6128b261e93fac954a48537c7 (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 preamble \
  17. # '%Proposal for a REGULATION OF THE EUROPEAN PARLIAMENT AND OF THE COUNCIL%' \
  18. # '/HAVE ADOPTED THIS REGULATION:/' \
  19. # '%%' '{*}'
  20. doit rec \
  21. '/^# \(Title\|Article\)/' '{25}' \
  22. '%%' '{*}'
  23. done
  24. log_action_end_msg $?