These scripts automate various programming and sysadmin tasks. This project contains utilities for:
To install, run the following (or put it at the top of a script).
Then, the scripts are available at /tmp/$USER/plume-scripts.
if [ -d /tmp/$USER/plume-scripts ] ; then
git -C /tmp/$USER/plume-scripts pull -q > /dev/null 2>&1
else
mkdir -p /tmp/$USER && git -C /tmp/$USER clone --depth=1 -q https://github.com/plume-lib/plume-scripts.git
fiIf you want to use a specific version of plume-scripts rather than the
bleeding-edge HEAD, you can run git checkout _SHA_ after the git clone
command.
Most of the scripts use sh or bash,
but some of the scripts use perl or python.
A wrapper for cron jobs so that cron only sends email when an error has occurred. Documentation at top of file and at http://habilis.net/cronic/.
Filter the output of tools such as lint, to only show output for changed
lines in a diff or pull request.
Documentation at top of file.
Reads standard input, and if not empty calls the mail program on it.
In other words, acts like mail -e and is useful
when your version of mail does not support -e.
This feature is useful in scripts and cron jobs, but is not supported
in all versions of mail.
Documentation
at top of file.
Cleans up a path environment variable by removing duplicates and non-existent directories. Can optionally remove certain path elements. Works for either space- or colon- delimiated paths. Documentation at top of file.
Prints "yes" if this process is running under CI. Prints nothing otherwise.
Outputs the head GitHub organization and branch for a CI job. Works under Azure Pipelines, CircleCI, GitHub Actions, and Travis CI. Documentation at top of file.
Prints the SHA commit id corresponding to the most recent successful CI job. Documentation at top of file.
Replace all matching regular expressions in the given files (or all files under the current directory). The timestamp on each file is updated only if the replacement is performed. Documentation at top of file.
Jeffrey Friedl's search program combines find and grep --
more or less do a 'grep' on a whole directory tree. search is more
efficient, uses Perl regular expressions, and is much more powerful.
This version fixes a tiny bug or two. For full documentation, see its
manpage.
This program has been largely superseded by
rg, and before that by
pt and
ag. However, it is still useful because it
searches more thoroughly: in git-ignored files, and in compressed
archives.
Sorts the input lines by directory order: first, every file in a given directory, in sorted order; then, process subdirectories recursively, in sorted order. This is useful for users (e.g., when printing) and for making output deterministic. Documentation at top of file.
Sorts the input errors/warnings by filename. Works for any tool that produces output in the standard format. This is useful for compilers such as javac that process files in nondeterministic order. Documentation at top of file.
code-style.mak is a Makefile that defines targets style-check and
style-fix. You can include this Makefile within your own (see
documentation). Then make style-check will run a linter on
any files of these types that exist under the Makefile:
HTML,
Markdown,
Python,
Shell scripts,
YAML.
You can explicitly
exclude files and directories from style checking.
Documentation at top of file.
Check that a class file's version is ≤ the specified version. This ensures that the class will run on a particular version of Java. Documentation at top of file.
Check that the Jacoco coverage has not decreased for any class. Documentation at top of file.
Determines all files that are recursively \input by a given
LaTeX file.
Documentation at top of file.
The program has two modes:
- Inline mode (the default): Create a single LaTeX file for the document,
by inlining
\inputcommands and removing comments. The result is appropriate to be sent to a publisher. - List mode: List all the files that are (transitively)
\input. This can be useful for getting a list of source files in a logical order, for example to be used in a Makefile or Ant buildfile.