--- /dev/null
+#!/bin/bash
+# Copyright © 2021 Steve Youngs. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# Author: Steve Youngs <steve@sxemacs.org>
+# Maintainer: Steve Youngs <steve@sxemacs.org>
+# Created: <2021-06-23>
+# Time-stamp: <Wednesday 23 Jun 2021 12:01:33 (steve)>
+# Homepage: https://git.sxemacs.org/pkgusr
+# Keywords: pkgusr package-management tools
+
+## This file is part of pkgusr
+
+### Commentary:
+#
+# Runs all the executable scripts found in a directory, but not
+# "backup" files (*.bak, *.orig, *.new, *.rej, *~)
+#
+# This script is based on the one that Pat Volkerding ships with
+# Slackware.
+
+# keep going when something fails
+set +e
+
+if [ $# -lt 1 ]; then
+ echo "Usage: run-parts <directory>"
+ exit 1
+fi
+
+if [ ! -d $1 ]; then
+ echo "Not a directory: $1"
+ echo "Usage: run-parts <directory>"
+ exit 1
+fi
+
+# Main loop:
+for SCRIPT in $1/* ; do
+ # Skip backup, non-regular, non-executable files
+ if [[ "$SCRIPT" =~ ^.*(~|#|\.(bak|orig|new|rej))$ ||
+ ! -f $SCRIPT || ! -x $SCRIPT ]]; then
+ continue
+ fi
+ # Run what makes it this far.
+ $SCRIPT || echo "$SCRIPT failed."
+done
+
+exit 0
+
+### run-parts ends here
+# Local variables:
+# coding: utf-8
+# end: