aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2025-05-17*: grfixAlejandro Colomar8-8/+8
Scripted change: $ grep -rl 'The authors of the Linux man-pages' \ | xargs sed -i '/Copyright, The authors of the Linux man-pages project/s/The/the/'; Reported-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-05-10*, AUTHORS: Consistently refer to authorsAlejandro Colomar8-8/+8
- Rename the file CREDITS => AUTHORS - Say 'authors' in the copyright notice. Scripted change: $ grep -rn 'The contributors to the Linux man-pages' -l \ | xargs sed -i '/Copyright, The contributors to the Linux man-pages project/s/contributors to/authors of/' Suggested-by: Dave Martin <Dave.Martin@arm.com> Acked-by: "G. Branden Robinson" <branden@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-05-06*, CREDITS: Unify copyright noticesAlejandro Colomar8-36/+8
Link: <https://lore.kernel.org/linux-man/jpin2dbnp5vpitnh7l4qmvkamzq3h3xljzsznrudgioox3nn72@57uybxbe3h4p/T/#u> Link: <https://www.linuxfoundation.org/blog/blog/copyright-notices-in-open-source-software-projects> Cc: "G. Branden Robinson" <branden@debian.org> Cc: Carlos O'Donell <carlos@redhat.com> Cc: Eugene Syromyatnikov <evgsyr@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-01-10src/bin/duffman, scripts/bash_aliases: Move duffman() to a separate scriptAlejandro Colomar1-20/+0
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-12-15scripts/bash_aliases: duffman(): Silence output of cp(1)Alejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-12-06scripts/bash_aliases: duffman: Pass any arguments (options) to diffman(1)Alejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-26scripts/bash_aliases: duffman(): Add function to diff all modified pagesAlejandro Colomar1-0/+20
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-26src/bin/sortman, sortman.1, share/mk/: Move sortman script to src/bin/, and ↵Alejandro Colomar1-15/+0
add manual page Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-04scripts/bash_aliases: man_gitstaged(): Trim the dirname(1) only for files ↵Alejandro Colomar1-4/+4
within man/ I changed the behavior at some point to trim the dirname(1) for every file. However, that was mainly due to the inconvenience of not having a man/ directory. Also, I haven't been consistent with that behavior, and have been manually adding back the dirname(1), so let's bring back the old behavior --which is BTW still what the comment says it does--. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-03src/bin/pdfman, scripts/bash_aliases, pdfman.1: Make pdfman a standalone ↵Alejandro Colomar1-11/+0
program, and add a manual page Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-03scripts/bash_aliases: pdfman(): Don't have custom error messageAlejandro Colomar1-5/+0
Run man(1) transparently, and let it report the error. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-03scripts/bash_aliases: pdfman(): Use -Tpdf directlyAlejandro Colomar1-3/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-03scripts/bash_aliases: man_lsfunc(), man_lsvar(): Use pcre2grep(1) instead of ↵Alejandro Colomar1-3/+3
pcregrep(1) pcregrep(1) is obsolete. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-03scripts/bash_aliases: man_lsfunc(), man_lsvar(): Use mansect(1)Alejandro Colomar1-39/+6
Remove the man_section() function, and call the mansect(1) program instead. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-26share/mk/: Reorganize files for generating the PDF bookAlejandro Colomar3-1897/+0
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-26share/mk/: Generate the fonts during the buildAlejandro Colomar3-11377/+0
Suggested-by: "G. Branden Robinson" <branden@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-24share/mk/, scripts/LinuxManBook/build.sh: Embed script in the makefilesAlejandro Colomar1-25/+0
This is done for simplifying, and as a side effect, it also allows much more control on the script (e.g., TROFFFLAGS). Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-21scripts/LinuxManBook/prepare.pl: Use more robust pipelinesAlejandro Colomar1-2/+7
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-14scripts/LinuxManBook/build.sh, share/mk/: Use command variablesAlejandro Colomar1-10/+20
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-12scripts/LinuxManBook/prepare.pl: Support some autogenerated pages from other ↵Deri1-12/+14
projects And remove a warning about an experimental perl feature, by using a while instead of a for loop. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-12-01scripts/LinuxManBook/: Simplify pipelineAlejandro Colomar5-851/+110
Call the groff(1) pipeline only once. This optimizes around 2 seconds, while also simplifying the code. This change was originally written by Deri, with some parts written by Brian. I took the script that Deri sent, and split it so that the groff(1) pipeline is called from the shell script, and the Perl script is limited to editing the man(7) pages. This helps me understand the process, since my understanding of Perl is very limited. It also makes this change smaller, so that it's less of a big-bang. Link: <https://lore.kernel.org/linux-man/ZWkO4qPC4BxkwBNm@debian/T/#m3d453440b02dd189bc12d2e629c4026206025b40> Co-developed-by: Deri James <deri@chuzzlewit.myzen.co.uk> Co-developed-by: Brian Inglis <Brian.Inglis@Shaw.ca> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-11-24scripts/LinuxManBook/: Shorten names of scriptsAlejandro Colomar2-2/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-11-24scripts/LinuxManBook/prepare_linux_man_book.pl: Add new function BuildSec()Alejandro Colomar1-1/+10
The intention is to move some code from BuildPage() into this function, reducing the complexity of that inner function. As a side effect, just by adding this function, I've already noticed an optimization of 0.3 s. The reason, I guess, is that it starts processing pages without waiting for the entire sort to complete, which reduces the latency of the script. Cc: Deri James <deri@chuzzlewit.myzen.co.uk> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-11-24scripts/LinuxManBook/build_linux_man_book.sh: Call pic(1), and call it after ↵Alejandro Colomar1-1/+2
preconv(1) Call it, just in case we want to use in manual pages in the future. It doesn't hurt performance. And call it after preconv(1), which should be the first program in the groff(1) pipeline. Suggested-by: Deri James <deri@chuzzlewit.myzen.co.uk> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-11-24scripts/LinuxManBook/prepare_linux_man_book.pl: Don't support trailing white ↵Alejandro Colomar1-2/+0
space nor \r Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-11-24*: Remove trailing white spaceAlejandro Colomar9-74/+74
Scripted change: $ grep -rl '\s$' | xargs sed -i 's/ * * *$//g' Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-11-22scripts/LinuxManBook/build_linux_man_book.sh: Simplify groff(1) callAlejandro Colomar1-3/+3
We're suppressing formatted device-independent output of troff(1), so it doesn't make sense to pass an option to gropdf(1) with -P. We don't need the fonts either. We don't even need groff(1), since we're only using troff(1). Redirect to /dev/null, instead of using -z. It's more explicit. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-11-22scripts/LinuxManBook/build_linux_man_book.sh: Explicitly preprocess before ↵Alejandro Colomar1-2/+6
calling groff(1) Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-11-22scripts/LinuxManBook/build_linux_man_book.sh: Allow running from any working ↵Alejandro Colomar1-6/+8
directory Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-11-22scripts/LinuxManBook/build_linux_man_book.sh: Use pipes instead of temporary ↵Alejandro Colomar1-15/+15
files It's still easy to debug, by inserting |tee /dev/tty|, but the script is cleaner if it doesn't generate intermediary files, and it's also faster (on my desktop computer, it goes down from 18.5 s to 16.3 s). Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-11-22scripts/LinuxManBook/build_linux_man_book.sh: LicenseAlejandro Colomar1-0/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-11-22scripts/LinuxManBook/prepare_linux_man_book.pl: Use a helper function for ↵Alejandro Colomar1-68/+75
building pages Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-11-22scripts/LinuxManBook/prepare_linux_man_book.pl: wsfixAlejandro Colomar1-167/+137
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-11-21scripts/LinuxManBook/: Split the pipeline for building the Linux Man BookAlejandro Colomar3-23/+30
This helps understand how this book is built. The Perl script was too magic for my taste. Now it does less magic. :) Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-28scripts/sortman: Treat [_-] as a spaceAlejandro Colomar1-1/+1
This sorts 'cat-woman' next to 'cat', before 'catatonic'. Suggested-by: Brian Inglis <Brian.Inglis@Shaw.ca> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-21scripts/sortman: Sort 'cat' before 'catatonic'Alejandro Colomar1-1/+2
Reported-by: Deri James <deri@chuzzlewit.myzen.co.uk> Cc: Brian Inglis <Brian.Inglis@Shaw.ca> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-16scripts/sortman: Tighten regexAlejandro Colomar1-1/+1
This avoids misinterpreting file names like .../binutils-2.17/... Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-14scripts/sortman: Ignore only leading underscores or dashesAlejandro Colomar1-1/+1
Underscores or dashes in the middle of words should be significant: man5/procfs.5 man5/proc.5 man5/proc_a.5 man5/proc_z.5 Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-14scripts/sortman: Use version sortAlejandro Colomar1-7/+9
This is to collate correctly pages like the following: man7/iso-8859-1.7 man7/iso-8859-2.7 man7/iso-8859-3.7 man7/iso-8859-4.7 man7/iso-8859-5.7 man7/iso-8859-6.7 man7/iso-8859-7.7 man7/iso-8859-8.7 man7/iso-8859-9.7 man7/iso-8859-10.7 man7/iso-8859-11.7 man7/iso-8859-13.7 man7/iso-8859-14.7 man7/iso-8859-15.7 man7/iso-8859-16.7 Also ignore case, since otherwise a version sort would collate 'Z' before 'a'. We don't need LC_COLLATE anymore. Version sort has some issues for our purpose: underscores and dashes have special (and different) meaning. We want to ignore underscores or dashes that aren't next to digits, so that _exit(2) remains next to exit(2). However, we want to keep them next to digits, such as in iso-8859-1(7), to keep the right order for pages with numbers. For that, we need some extra sed(1) magic. Reported-by: Brian Inglis <Brian.Inglis@Shaw.ca> Cc: Deri James <deri@chuzzlewit.myzen.co.uk> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-13scripts/sortman: Support pages in sections 0 and 9Alejandro Colomar1-3/+3
Our project doesn't have them, but others do. Remove that arbitrary limitation. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-13scripts/sortman: Support pages with suffixes (not subsections)Alejandro Colomar1-3/+3
Some projects have pages with suffixes like '.man' or '.in'. Don't misinterpret those as subsections. Pages with subsections should match the following regex: '\.[[:digit:]][[:alnum:]]\>'. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-13scripts/sortman: Add script to sort manual pages in book orderAlejandro Colomar1-0/+12
`LC_COLLATE=en_US.UTF-8` is needed to collate pages like _exit(3) next to exit(3), instead of having all pages with a leading underscore grouped at the beginning of a section. intro(*), of course, is the fist page of each section, and subsections go after the last page in the main corresponding section. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-12scripts/LinuxManBook/: Update for groff-1.23.0Deri James10-9517/+298
Now that 1.23.0 has been released we can chop a lot of code. Reported-by: Brian Inglis <Brian.Inglis@Shaw.ca> Reported-by: Alejandro Colomar <alx@kernel.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-05-24bash_aliases: Increase robustness of sed_rm_ccomments()Alejandro Colomar1-4/+5
Thanks to perl(1), we can use a non-greedy match to remove several C89-style comments in the same line. And by splitting (and slightly modifying) the other sed(1) call, we can handle multi-line comments that start in the same line that the previous one ends. Now the only remaining issue is nested comments, but that's rare, so let's ignore it for now. $ cat com.c /* let's see */ int foo/*how about here?*/; // meh int bar; /* Let's see how this behaves */ int baz; /* like this? like that! */ int qwe; // asdasd $ sed_rm_ccomments <com.c int foo; int bar; int baz; int qwe; Here's what can and will be problematic: // /* int foo; /* */ Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-08bash_aliases: Optimize man_section()Alejandro Colomar1-1/+2
mandoc(1) renders pages much faster than groff(1), which is itself much faster than using man(1). This might seem irrelevant for a single page, but this function is called in a loop in man_lsfunc() and man_lsvar(), where this brings times down considerably. For comparison, `time man_lsfunc man*` took around 55 s (on my system) before this change. With groff(1), it would take around 14 s, and with mandoc(1) (this patch), it takes 4 s. Cc: Ingo Schwarze <schwarze@openbsd.org> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: Gavin Smith <gavinsmith0123@gmail.com> Cc: Dirk Gouders <dirk@gouders.net> Cc: Colin Watson <cjwatson@debian.org> Cc: Eli Zaretskii <eliz@gnu.org> Cc: Larry McVoy <lm@mcvoy.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-02scripts/LinuxManBook/: Make the title consistent with the name of the projectAlejandro Colomar2-2/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-30scripts: tfixSamanta Navarro2-6/+6
Typos found with codespell. Signed-off-by: Samanta Navarro <ferivoz@riseup.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-24scripts/LinuxManBook/: Add Deri's script for producing the man-pages bookAlejandro Colomar15-0/+23242
Deri is the author of all of this great work! I expect to be able to hook it into the build system, so that we can run `make book-pdf` (or something like that). Cc: Deri James <deri@chuzzlewit.myzen.co.uk> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-11-22bash_aliases: Remove grep_syscall(), grep_syscall_def(), and ↵Alejandro Colomar1-80/+0
grep_glibc_prototype() The functionality of those shell functions is covered by the grepc(1) program: <http://www.alejandro-colomar.es/src/alx/alx/grepc.git/>. The program has several bug fixes that these shell functions didn't receive. It also has more useful features. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-10-09dist.mk, All pages: .TH: Generate date at 'make dist'Alejandro Colomar1-19/+0
Replace the date by a placeholder (date) in the repo, as we're doing with the version (unreleased). It will be filled when the tarball is generated with 'make dist' (or equivalent) with the date of the most recent git commit that modifies the page (as was done previously by update_timestamps.sh, which has been removed). Scripted change (mostly): $ find man* -type f \ | xargs sed -Ei '/^\.TH /s/.TH +([^ ]+ +[^ ]+) +[^ ]+ +(.*)/.TH \1 (date) \2/' Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-10-09update_timestamps.sh: Ignore inexistent filesAlejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-08-24print_encoding.sh: Remove unused scriptAlejandro Colomar1-47/+0
It considers every page as utf-8, so it doesn't provide any useful information. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2022-08-24check_unbalanced_macros.sh: This script's functionality is already covered ↵Alejandro Colomar1-68/+0
by 'make lint-man' Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2022-08-24append_COLOPHON.sh, remove_COLOPHON.sh: Remove COLOPHON section.Alejandro Colomar2-66/+0
Users should use their distribution's standard tools to know where a given page comes from and to know how to report a bug. That'll create a small barrier to bug reporters, but that'll hopefully help improve the quality of the reports. It'll also make the pages cleaner, by removing stuff that is obvious to those who know how to use their tools. We still keep part of the information of the COLOPHON, specifically the project name and the version, in the .TH line. Reported-by: Ingo Schwarze <schwarze@openbsd.org> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2022-07-29Many pages: Use STANDARDS instead of CONFORMING TOAlejandro Colomar1-1/+1
STANDARDS seems to be much more extended than CONFORMING TO. For consistency across the whole manual pages corpus, let's try to unify, by following the most commonly used section name. On 7/27/22 12:49, Ingo Schwarze wrote: > Alejandro Colomar wrote on Tue, Jul 26, 2022 at 02:02:56PM +0200: > > We use CONFORMING TO in Linux. Don't know why; just history, I guess. > > See man-pages(7). > > Weird. > > I failed to find a single instance of "CONFORMING TO" in AT&T UNIX > (including v6, PWB, v7, 32v, v8, v10, System III, SVR1, SVR2) nor in > any version of UCB CSRG BSD. So considering that System V and BSD are > widely considered the two main original branches of the development > of Unix-like operating systems and Linux is often considered to have > drawn inspiration from both, the section name "CONFORMING TO" does > not appear to be a UNIX thing. For example, Aeleen Frisch, "Essential > System Administration", O'Reilly, Cambridge 1995, considers Linux > as slightly more influenced by 4.3BSD than by System V Release 3. > > STANDARDS, on the other hand, is present since 4.3BSD-Reno (June 1990). > > 4.3BSD-Reno predates the first version of the Linux kernel by more than > a year, and the first Linux manual pages probably for longer than that. > > So i have no idea where "CONFORMING TO" may have come from. Scripted change: $ find man* -type f | xargs sed -i 's/CONFORMING TO/STANDARDS/' plus a few manual fixes to the following files: - man2/getrlimit.2 - man3/syslog.3 - scripts/bash_aliases Reported-by: Ingo Schwarze <schwarze@openbsd.org> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2022-07-22bash_aliases: man_gitstaged(): Never show dirsAlejandro Colomar1-3/+3
Directories are obvious also for scripts, or other non-man(7) files. Also, this adds support for man3type and man2type pages. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2022-06-08update_timestamps.sh: Add script to update the pages' timestampsAlejandro Colomar1-0/+18
This differs from what was being done until now. Before, we were updating the timestamp with the date of the release, but that's unnecessarily unprecise. With this, we have the actual date of when the last change was committed. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2022-05-30remove_COLOPHON.sh: srcfixAlejandro Colomar1-1/+1
SC2068 (error): Double quote array expansions to avoid re-splitting elements. Reported-by: shellcheck(1) Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2022-05-22bash_aliases: srcfixAlejandro Colomar1-51/+49
SC2034 (warning): EX_OK appears unused. SC2035 (info): Use ./*glob* or -- *glob* so names with dashes won't become options. SC2068 (error): Double quote array expansions to avoid re-splitting elements. SC2086 (info): Double quote to prevent globbing and word splitting. SC2112 (warning): 'function' keyword is non-standard. Delete it. SC2124 (warning): Assigning an array to a string! Assign as array, or use * instead of @ to concatenate. SC3001 (warning): In POSIX sh, process substitution is undefined. SC3006 (warning): In POSIX sh, standalone ((..)) is undefined. Also, remove unnecessary braces, and update copyright. Reported-by: shellcheck(1) Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2022-05-22bash_aliases: Add reference to grepc(1)Alejandro Colomar1-0/+6
grepc(1) has some of the features implemented in our bash_aliases, and then some. It also is shorter to type, and has a rich set of command line options. Link: <http://www.alejandro-colomar.es/src/alx/alx/grepc.git/> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2022-05-02scripts/append_COLOPHON.sh: Add script to append the COLOPHON sectionAlejandro Colomar1-0/+38
I first implemented it using cat <<-, but sed(1) is around 5 times faster, so even if it's a bit more complex and slightly less readable, let's use sed(1). Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2022-05-02scripts/remove_COLOPHON.sh: Allow passing directories to the scriptAlejandro Colomar1-3/+3
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2022-04-02scripts/bash_aliases: grep_syscall[_def](): Fix bug that couldn't find ↵Alejandro Colomar1-2/+2
syscalls with 0 args Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2022-02-25scripts/bash_aliases: man_lsfunc(): Fix some corner casesAlejandro Colomar1-2/+2
Although 'int foo(...);' is not a valid C prototype, we use it in one manual page: sigreturn(2). Fix man_lsfunc() to find that prototype. When a syscall(SYS_...) function doesn't have any arguments (except for the SYS_* constant), there's not a comma between the parentheses. Adapt the regex for that. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2022-01-23.gitignore, Makefile, scripts/bash_aliases: Adapt to the recently added ↵Alejandro Colomar1-1/+1
section 0 (man0/) Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2021-11-14bash_aliases: grep_*(): OptimizeAlejandro Colomar1-0/+4
Using grep first to reduce the files on which pcregrep is run optimizes considerably the performance of these functions. If a file doesn't contain the name of a function, which can easily be checked with grep, it won't possibly contain the function prototype or definition, which is much slower to search, since it implies multiline pcregrep search. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2021-10-06scripts/bash_aliases: pdfman(): Generalize the toolAlejandro Colomar1-5/+4
Accept man(1) syntax, so that the function can open system manual pages by [optional] section and page name. As a side effect, this simplifies the invocation of man(1), which didn't need '-l'. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2021-08-08scripts/bash_aliases: tfixJakub Wilk1-1/+1
Signed-off-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11scripts/bash_aliases: man_lsfunc(): Extract syscall name from syscall(SYS_...)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10scripts/bash_aliases: srcfixAlejandro Colomar1-12/+12
I clarified the code about two things: - Checking how many arguments are being passed. Here, some functions didn't reject extra arguments when they weren't being used. Fix that. I also changed the code to use $#, which is more explicit. And use arithmetic expressions, which better indicate that we're dealing with numbers. - Remove unneeded options from sort. Reported-by: Stefan Puiu <stefan.puiu@gmail.com> After Stefan asked about why am I using 'sort -V', I noticed that I really don't need '-V', and it may confuse people trying to understand the script, so even though I slightly prefer the output of 'sort -V', in this case, it's better to use the simpler 'sort' (yet I need 'sort', to maintain consistency in the results (find is quite random)). Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10scripts/bash_aliases: Fix error messagesAlejandro Colomar1-2/+2
Fix the error messages to clearly show that both dirs and manual pages are accepted, and that more than one argument is accepted. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10scripts/bash_aliases: man_section(): Accept multiple sectionsAlejandro Colomar1-10/+19
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10scripts/bash_aliases: Add man_lsvar(), similar to man_lsfunc() but lists ↵Alejandro Colomar1-0/+27
variables Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10scripts/bash_aliases: Make man_lsfunc() more robust; Add sed_rm_ccomments().Alejandro Colomar1-18/+21
This patch makes man_lsfunc() search for the function prototypes, instead of relying on the current manual page formatting, which might change in the future, and break this function. It also simplifies the code, by reusing man_section(). Create a new function sed_rm_ccomments(), which is needed by man_lsfunc(), and may also be useful in other cases. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10scripts/bash_aliases: man_gitstaged(): Script around a porcelain git commandAlejandro Colomar1-5/+3
The output of 'git status' is not stable. The more stable 'git status --porcelain' is more complex, and scripting around it would be more complex. However, 'git diff --staged --name-only' produces the output that we were lookiong for. Reported-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10scripts/bash_aliases, scripts/modified_pages.sh: Move ↵Alejandro Colomar2-35/+16
scripts/modified_pages.sh to a function man_gitstaged() Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03scripts/bash_aliases: tfixJakub Wilk1-1/+1
Signed-off-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-20scripts/bash_aliases: Add useful functionsAlejandro Colomar1-0/+171
That file should be sourced (.) from 'bashrc' (or 'bash_aliases'). It contains functions that are useful for the maintenance of this project. - grep_syscall() - grep_syscall_def() - man_section() - man_lsfunc() - pdfman() - grep_glibc_prototype() Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16Add script to get modified pages for commit messagesAlejandro Colomar1-0/+34
The script can be used this way: git commit -sm "$(./scripts/modified_pages.sh): Short commit msg" And then maybe --amend and add a longer message. This is especially useful for changes to many pages at once, usually when running a script to apply some global changes. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16check_unbalanced_macros.sh: A script to look for unbalanced *roff/man macro ↵Michael Kerrisk1-0/+68
pairs Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28man_show_fixme.sh: Don't hyphenate or justify the manual pageMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27FIXME_list.sh: Fix broken regexpMichael Kerrisk1-4/+4
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-30man_show_fixme.sh: Fix misquoted double quotes in regexpsMichael Kerrisk1-3/+3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-13drop "coding: UTF-8" headerMike Frysinger1-1/+1
This header is used inconsistently -- man pages are UTF-8 encoded but not setting this marker. It's only respected by the man-db package, and seems a bit anachronistic at this point when UTF-8 is the standard default nowadays. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-31scripts: mark them executableMike Frysinger11-0/+0
It's easier to run `./scripts/foo.sh ...` than `bash ./scripts/foo.sh ...`. Mark them all +x to support that. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-27man_show_fixme.sh: Fix rendering issueMichael Kerrisk1-0/+1
If a single quote falls at the start of a line, then the rest of the line is treated as a comment. Therefore, escape single quotes. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-10-31man_show_fixme.sh: strip extraneous blank line at start of rendered FIXME outputMichael Kerrisk1-0/+7
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-10-31man_show_fixme.sh: Minor tweaksMichael Kerrisk1-3/+5
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-10-31man_show_fixme.sh: Tweak indent linesMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-10-31man_show_fixme.sh: fMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-10-29man_show_fixme.sh: Make output tables a little narrowerMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-10-29man_show_fixme.sh: script to show FIXMEs in rendered man pagesMichael Kerrisk1-0/+45
A script that renders man pages with FIXMES as table in rendered text. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-07scripts/markup_check.sh: tfixJakub Wilk1-1/+1
Signed-off-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-03-22find_repeated_words.sh: Do not process files that are redirectsStéphane Aulery1-0/+4
Signed-off-by: Stéphane Aulery <saulery@free.fr> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-08-21Update usage messageMichael Kerrisk1-1/+1
2014-02-18convert_to_utf_8.sh: Fix buggy treatment of iso_8859-{11,13}.7Michael Kerrisk1-4/+7
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-02-16print_encoding.sh: Script to list pages that employ character sets other ↵Peter Schiffer1-0/+47
than us-ascii See https://bugzilla.kernel.org/show_bug.cgi?id=60807 Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-02-16convert_to_utf_8.sh: Script to convert pages to UTF-8Peter Schiffer1-0/+65
See https://bugzilla.kernel.org/show_bug.cgi?id=60807 Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-02-10markup_check.sh: Script to check for common man-page markup errorsMichael Kerrisk1-0/+48
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-09-16FIXME_list.sh, add_parens_for_own_funcs.sh, find_dots_no_parens.sh, ↵Michael Kerrisk7-0/+113
find_repeated_words.sh, find_slashes_no_parens.sh, remove_COLOPHON.sh, unformat_parens.sh: Add copyright and license Reported-by: Felix Janda <felix.janda@posteo.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-09-16FIXME_list.sh: srcfixMichael Kerrisk1-0/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-09-16find_repeated_words.sh: Add filename in commentsMichael Kerrisk1-0/+2
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-08-29find_repeated_words.sh: Fix bugMichael Kerrisk1-4/+3
setting of MANWIDTH needs to be in environmnt of "man -l" Signed-off-by: Michael Kerrisk <mtk@konstanz.(none)>
2008-01-13Script to remove the COLOPHON section from the man pages provided asMichael Kerrisk1-0/+13
command-line arguments. This is useful to remove the COLOPHON sections from all of the man pages in two different release trees in order to do a "diff -ruN" to see the "real" differences between the trees.
2007-09-19error fixMichael Kerrisk1-1/+1
2007-09-10Minor changesMichael Kerrisk1-1/+4
2007-06-14handle "FIXME ?"Michael Kerrisk1-1/+7
2007-06-09minor fixesMichael Kerrisk4-12/+13
2007-03-02Small comment fix.Michael Kerrisk1-2/+2
2007-03-01Find duplicate consecutive words in filesMichael Kerrisk1-0/+17
2006-07-18Allow multiple directory command-line argumentsMichael Kerrisk1-41/+44
2006-07-11Better name.Michael Kerrisk1-0/+0
2006-07-11Name changeMichael Kerrisk1-1/+1
2006-07-11A script that displays FIXMEs in the man page source filesMichael Kerrisk1-0/+76
2005-10-19minor fixesMichael Kerrisk2-2/+2
2005-10-19Maintenance scriptsMichael Kerrisk2-0/+128
2005-10-19Maintenance scriptsMichael Kerrisk3-0/+350