logo

cross-unix-documentation

documentation of similarities and (noteworthy) differencies between Unix systems git clone https://hacktivis.me/git/cross-unix-documentation.git

new-manpage.sh (1138B)


  1. #!/bin/sh
  2. # This file is part of Cross Unix Documentation
  3. # Copyright © 2019-2020 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
  4. # SPDX-License-Identifier: CC-BY-4.0
  5. name="$2"
  6. section="${1}x"
  7. usage() {
  8. echo "${0} <section> <name>"
  9. echo "where section is one of [1-8]"
  10. exit 1
  11. }
  12. [[ -z "$name" ]] && usage
  13. [[ -z "$section" ]] && usage
  14. man_file=man${section}/${name}.${section}
  15. cat >"${man_file}" <<EOF
  16. .\" This file is part of Cross Unix Documentation
  17. .\" Copyright © 2019-$(date +%Y) Haelwenn (lanodan) Monnier <contact@hacktivis.me>
  18. .\" SPDX-License-Identifier: CC-BY-4.0
  19. .Dd $(date +%F)
  20. .Dt $(tr '[:lower:]' '[:upper:]' <<<"${name}") ${section}
  21. .Os
  22. .Sh PROLOG
  23. This manual page is part of
  24. .Lk https://hacktivis.me/git/cross-unix-documentation "Cross-Unix Documentation"
  25. which is an attempt to provide documentation of similarities and (noteworthy)
  26. differencies between Unix-like systems.
  27. To be used as an addition to the POSIX standard.
  28. .Sh NAME
  29. .Nm ${name}
  30. .Nd [short description]
  31. .Sh SYNOPSIS
  32. .Nm
  33. .Sh DESCRIPTION
  34. .Sh SOURCE
  35. .Sh AUTHORS
  36. .An Haelwenn (lanodan) Monnier Aq Mt contact+c-u-d@hacktivis.me
  37. EOF
  38. $EDITOR ${man_file}