needs work, but tee implemented in sh
This commit is contained in:
parent
f2d788e85f
commit
f4011d25a7
21
mm/tee
Executable file
21
mm/tee
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
while getopts :ai c
|
||||
do case "$c" in
|
||||
a) line="$(printf '%s -a ' "$line")" ;;
|
||||
i) line="$(printf '%s -n ' "$line")" ;;
|
||||
*) printf 'Usage: %s (-ai) (file...)\n' "$0"
|
||||
exit 64 # sysexits(3) EX_USAGE
|
||||
esac
|
||||
done
|
||||
|
||||
shift "$(printf '%s - 1\n' "$OPTIND" | bc)"
|
||||
|
||||
line="$(printf '%s -o - ' "$line")"
|
||||
|
||||
for file in "$@";
|
||||
do >"$file"
|
||||
line="$(printf '%s -o %s ' "$line" "$file")"
|
||||
done
|
||||
|
||||
exec mm $line
|
Loading…
Reference in New Issue
Block a user