summaryrefslogtreecommitdiff
path: root/bin/common/toush
blob: dd675b9c737fb658381aace503a652686a3d7698 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
# fork of
# https://codeberg.org/futxlii/bin/toush :)

shebang='#!/bin/sh'

usage() { >&2 printf 'Usage: %s' "${0##*/}"; exit 1 ;}

[ "$1" ] || usage
while [ "$1" ]; do
	[ -f "$1" ] && usage
	printf '%s\n\n' "$shebang" > "$1" && chmod +x "$1"
	shift
done