2024-01-15 14:23:54 -07:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
while getopts :ai c
|
|
|
|
do case "$c" in
|
|
|
|
a) line="$(printf '%s -a ' "$line")" ;;
|
|
|
|
i) line="$(printf '%s -n ' "$line")" ;;
|
2024-01-15 14:26:23 -07:00
|
|
|
*) printf 'Usage: %s (-ahi) (file...)\n' "$0"
|
2024-01-15 14:23:54 -07:00
|
|
|
exit 64 # sysexits(3) EX_USAGE
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
shift "$(printf '%s - 1\n' "$OPTIND" | bc)"
|
|
|
|
|
2024-01-15 14:24:32 -07:00
|
|
|
line="$(printf '%s -u -o - ' "$line")"
|
2024-01-15 14:23:54 -07:00
|
|
|
|
|
|
|
for file in "$@";
|
|
|
|
do >"$file"
|
|
|
|
line="$(printf '%s -o %s ' "$line" "$file")"
|
|
|
|
done
|
|
|
|
|
|
|
|
exec mm $line
|