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 (823B)


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