more work on tee and also a cat too
This commit is contained in:
parent
d46a6aac3c
commit
cb3dac04e9
17
mm/cat
Executable file
17
mm/cat
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
while getopts :u c
|
||||||
|
do case "$c" in
|
||||||
|
u) line="$(printf '%s -u ' "$line")" ;;
|
||||||
|
*) printf 'Usage: %s (-hu) (file...)\n' "$0"
|
||||||
|
exit 64 # sysexits(3) EX_USAGE
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
shift "$(printf '%s - 1\n' "$OPTIND" | bc)"
|
||||||
|
|
||||||
|
for file in "$@";
|
||||||
|
do line="$(printf '%s -i %s ' "$line" "$file")"
|
||||||
|
done
|
||||||
|
|
||||||
|
exec mm $line
|
2
mm/tee
2
mm/tee
@ -4,7 +4,7 @@ while getopts :ai c
|
|||||||
do case "$c" in
|
do case "$c" in
|
||||||
a) line="$(printf '%s -a ' "$line")" ;;
|
a) line="$(printf '%s -a ' "$line")" ;;
|
||||||
i) line="$(printf '%s -n ' "$line")" ;;
|
i) line="$(printf '%s -n ' "$line")" ;;
|
||||||
*) printf 'Usage: %s (-ai) (file...)\n' "$0"
|
*) printf 'Usage: %s (-ahi) (file...)\n' "$0"
|
||||||
exit 64 # sysexits(3) EX_USAGE
|
exit 64 # sysexits(3) EX_USAGE
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user