$(SUBST) $(srcdir)/hush.1.in >$@.new $(SUBSTITUTIONS) && \
mv $@.new $@
+dist_bin_SCRIPTS += with-umask
+dist_man_MANS += with-umask.1
+
## bash scripts.
if HAVE_BASH
Section: utils
Description: Captures stdin in a temporary file and runs a command.
+Package: with-umask
+Architecture: all
+Section: utils
+Description: Runs a command with a given umask.
+
Package: create
Architecture: all
Section: utils
x86-model.1 x86-model /usr/share/man/man1
hush hush /usr/bin
hush.1 hush /usr/share/man/man1
+with-umask with-umask /usr/bin
+with-umask.1 with-umask /usr/share/man/man1
--- /dev/null
+#! /bin/sh -e
+
+prog=${0##*/}
+usage="usage: $prog MASK CMD [ARGS ...]"
+case $1,$# in
+ -h,*) echo "$usage"; exit 0 ;;
+ -*) echo >&2 "unknown option \`$1'"; exit 1 ;;
+ ,0 | *,1) echo >&2 "$usage"; exit 1 ;;
+esac
+umask $1
+shift
+exec "$@"
--- /dev/null
+.de VS
+.sp 1
+.RS
+.nf
+.ft B
+..
+.de VE
+.ft R
+.fi
+.RE
+.sp 1
+..
+.TH with-umask 1 "5 April 2015" "Edgeware tools"
+.SH NAME
+with-umask \- run a command with a particular umask set
+.SH SYNOPSIS
+.B with-umask
+.I mode
+.I command
+.RI [ arguments ...]
+.SH DESCRIPTION
+The
+.B with-umask
+program sets its umask to
+.I mode
+and then executes
+.I command
+with the given
+.IR arguments .
+.PP
+The
+.I mode
+may be either a literal mask written in octal, where set bits correspond
+to mode bits to be forced clear when creating files, or a symbolic mode
+in
+.BR chmod (1)
+style listing the mode bits to be preserved. (Other forms may be
+acceptable:
+.B with-umask
+is currently a shell script, and uses
+.BR /bin/sh 's
+.B umask
+built-in to do its work.)
+.PP
+Command line options:
+.TP
+.B "\-h"
+Show very brief help, and exit.
+.SH BUGS
+None known.
+.SH AUTHOR
+Mark Wooding <mdw@distorted.org.uk>