diff options
author | VG <vg@devys.org> | 2016-01-25 20:41:59 +0100 |
---|---|---|
committer | VG <vg@devys.org> | 2016-01-25 20:41:59 +0100 |
commit | 8059f16f57bc578ba7a04d12c89587a8eb96f63f (patch) | |
tree | 8221cd243c12a07222a39ea41cc81db78e30c85a | |
parent | 1a2a7b0f68e5b6eb9dc315ac9f925ee75703d701 (diff) | |
download | bulkrename-8059f16f57bc578ba7a04d12c89587a8eb96f63f.tar.gz bulkrename-8059f16f57bc578ba7a04d12c89587a8eb96f63f.tar.bz2 bulkrename-8059f16f57bc578ba7a04d12c89587a8eb96f63f.zip |
regroup redirection to both files at the same time
-rwxr-xr-x | bulkrename | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -11,10 +11,9 @@ fi EDITOR="${EDITOR:-vi}" namebase="$(mktemp -d)/blkrn" -cat > "${namebase}.1" exec </dev/tty >/dev/tty || { echo 'Interactive terminal needed' >&2; exit; } +tee -- "${namebase}.1" >> "${namebase}.2" -cp "${namebase}.1" "${namebase}.2" "$EDITOR" "${namebase}.2" if [ $(wc -l < "${namebase}.1") -ne $(wc -l < "${namebase}.2") ] ; then |