<commit_before>
.\" Man page for midwife
.TH midwife 1 "02 January 2015" "Midwife"
.SH NAME
midwife \- invoke the appropriate interpreter in a shebang script
.SH SYNOPSIS
.B
midwife
.RI
.I percent\-encoded\-argument filename [arguments-to-command] ...


.\" Local Variables:
.\" eval: (add-hook 'write-file-functions 'time-stamp)
.\" eval: (add-hook 'before-save-hook 'time-stamp nil t)
.\" eval: (add-hook 'before-save-hook 'delete-trailing-whitespace nil t)
.\" time-stamp-start: ".TH midwife 1 \""
.\" time-stamp-format: "%02d %:b %:y"
.\" time-stamp-end: "\""
.\" mode: nroff
.\" End:
<commit_msg>Improved man page<commit_after>.TH midwife 1 "04 January 2015" "Midwife"
.SH NAME
midwife \- invoke the appropriate interpreter in a shebang script
.SH SYNOPSIS
.BI midwife " [%\-encoded\~argument] [SCRIPTFILE] [arguments-to-command]"
.P
.BI "midwife -n" "j filename [arguments-to-command]"
.P
.BI "midwife3" " filename [arguments-to-command]"
.SH DESCRIPTION
The #! ("shebang") mechanism is extremely useful for creating scripts
that can be executed via
.BR execve (2),
just like binary executables.
However, it suffers from several limitations:
.IP \(em
Handling of whitespace in the argument to the interpreter is not
portable: Darwin splits the argument on whitespace, while Linux does
not.
.IP \(em
No arguments may be passed after the script name but before the
script's arguments
.IP \(em
No way to interpolate the text of arguments in arguments provided to
the command
.P
The usual solution to these problems is a shell script
wrapper.
However, this has its own problems:
.IP \(em
Shells are complicated programs.
This makes them both potentially slow
to invoke, and vulnerable to security vulnerabilities (see the
"shellshock" bug in Bash).
.IP \(em
Using a shell script wrapper requires writing what is essentially a
polyglot sript where one of the languages is the shell.
This is clumsy and error-prone, and should not be needed anyway.
.P
Midwife is a solution to these problems.
It can be passed a template containing
.SH FILES
None
.SH ENVIRONMENT
If the command name is not an absolute path, $PATH is searched for the
executable using
.BR execvp (1).
.SH DIAGNOSTICS
.SH BUGS
Currently, Midwife is not aware of unicode.
Please report any other bugs you find to
.SH AUTHOR
<NAME> <<EMAIL>>
\" Local Variables:
\" eval: (add-hook 'write-file-functions 'time-stamp)
\" eval: (add-hook 'before-save-hook 'time-stamp nil t)
\" eval: (add-hook 'before-save-hook 'delete-trailing-whitespace nil t)
\" time-stamp-start: ".TH midwife 1 \""
\" time-stamp-format: "%02d %:b %:y"
\" mode: nroff
\" mode: auto-fill
\" End:

{'fraction_non_alphanumeric': 0.11386138613861387, 'fraction_numerical': 0.008758568164508759, 'mean_word_length': 3.994296577946768, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5851855', 'n_tokens_mistral': 888, 'n_tokens_neox': 814, 'n_words': 356}