├── Build.sh ├── FAQ2HTML.sh ├── Makefile ├── check.pl ├── check.t ├── dot.mkshrc ├── edit.c ├── emacsfn.h ├── eval.c ├── exec.c ├── expr.c ├── exprtok.h ├── funcs.c ├── histrap.c ├── jehanne.c ├── jobs.c ├── lalloc.c ├── lex.c ├── lksh.1 ├── main.c ├── mbsdcc.h ├── mbsdint.h ├── mirhash.h ├── misc.c ├── mksh.1 ├── mksh.faq ├── mksh.ico ├── os2.c ├── rlimits.opt ├── sh.h ├── sh_flags.opt ├── shf.c ├── strlcpy.c ├── syn.c ├── tree.c ├── ulimit.c ├── ulimits.opt ├── var.c └── var_spec.h /FAQ2HTML.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # -*- mode: sh -*- 3 | rcsid='$MirOS: src/bin/mksh/FAQ2HTML.sh,v 1.10 2025/04/25 23:14:50 tg Exp $' 4 | #- 5 | # Copyright © 2020, 2023 6 | # mirabilos 7 | # 8 | # Provided that these terms and disclaimer and all copyright notices 9 | # are retained or reproduced in an accompanying document, permission 10 | # is granted to deal in this work without restriction, including un‐ 11 | # limited rights to use, publicly perform, distribute, sell, modify, 12 | # merge, give away, or sublicence. 13 | # 14 | # This work is provided “AS IS” and WITHOUT WARRANTY of any kind, to 15 | # the utmost extent permitted by applicable law, neither express nor 16 | # implied; without malicious intent or gross negligence. In no event 17 | # may a licensor, author or contributor be held liable for indirect, 18 | # direct, other damage, loss, or other issues arising in any way out 19 | # of dealing in the work, even if advised of the possibility of such 20 | # damage or existence of a defect, except proven that it results out 21 | # of said person’s immediate fault when using the work as intended. 22 | #- 23 | # Generates a ./FAQ.htm out of source in the script directory. 24 | 25 | die() { 26 | echo >&2 "E: $*" 27 | exit 1 28 | } 29 | 30 | LC_ALL=C; LANGUAGE=C 31 | export LC_ALL; unset LANGUAGE 32 | nl=' 33 | ' 34 | srcdir=`dirname "$0" 2>/dev/null` || die 'cannot find srcdir' 35 | 36 | p=--posix 37 | sed $p -e q /dev/null 2>&1 || p= 38 | 39 | v=$1 40 | if test -z "$v"; then 41 | v=`sed $p -n '/^#define MKSH_VERSION "\(.*\)"$/s//\1/p' "$srcdir"/sh.h` 42 | fi 43 | test -n "$v" || die 'cannot find version' 44 | src_id=`sed $p -n '/^RCSID: /s///p' "$srcdir"/mksh.faq` 45 | # sanity check 46 | case x$src_id in 47 | x) 48 | die 'cannot find RCSID' 49 | ;; 50 | *"$nl"*) 51 | die 'more than one RCSID in mksh.faq?' 52 | ;; 53 | esac 54 | 55 | sed $p \ 56 | -e '/^RCSID: \$/s/^.*$/----/' \ 57 | -e 's!@@RELPATH@@!http://www.mirbsd.org/!g' \ 58 | -e 's^  ' \ 59 | "$srcdir"/mksh.faq >FAQ.tm1 || die 'sed (1)' 60 | tr '\n' '' FAQ.tm2 || die 'tr (2)' 61 | sed $p \ 62 | -e 'sg' \ 63 | -e 's----g' \ 64 | -e 's\([^]*\)\1g' \ 65 | -e 's\([^]*\)\1g' \ 66 | -e 's\([^]*\)*ToC: \([^]*\)Title: \([^]*\)\([^]*\)\{0,1\}

\3


g' \ 67 | -e 's[^]*

g' \ 68 | -e 's^
*' \ 69 | -e 's$' \ 70 | -e 's<><>g' \ 71 | -e 'sg' FAQ.tm3 || die 'sed (3)' 72 | tr '' '\n' FAQ.tm4 || die 'tr (4)' 73 | 74 | exec >FAQ.tm5 75 | cat < 78 | 79 | 80 | 81 | mksh $v FAQ (local copy) 82 | 83 | 84 | 125 | 126 |

Note: Links marked like this 127 | one to the mksh IRC channel connect to external resources.

128 |

Notice: the website will have the latest version of the 130 | mksh FAQ online.

131 |

Table of Contents

132 |