summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2019-01-29 09:21:49 +0000
committerKatolaZ <katolaz@freaknet.org>2019-01-29 09:21:49 +0000
commite9a84ca044c10e9676a351820d5719b2d5f51554 (patch)
tree6f5810f3cd56782c59d7323b06ca7b554c157c01
parent85edc980a0b9e83070948f52b404c0b425a437c7 (diff)
put tee outside the loop0.1
-rwxr-xr-xphrollo9
1 files changed, 4 insertions, 5 deletions
diff --git a/phrollo b/phrollo
index 89a7574..0582b18 100755
--- a/phrollo
+++ b/phrollo
@@ -6,12 +6,11 @@ FILEIN="${1:-/dev/stdin}"
IFS=' '
while read -r D T S H P SH; do
NSH="$(printf "$S\r\n" | nc "$H" "$P" | shasum -a 256 | cut -d " " -f 1)"
- [ $? -eq 0 ] &&
[ "${SH}" != "${NSH}" ] && {
- D="$(date +%Y%m%d)"
+ D="$(date +%Y%m%d)"
SH="${NSH}"
}
- printf "%s\t%s\t%s\t%s\t%s\t%s\n" "$D" "$T" "$S" "$H" "$P" "$SH" | tee /dev/stderr
-done < "${FILEIN}" | sort -rnk1 -k2 | \
+ printf "%s\t%s\t%s\t%s\t%s\t%s\n" "$D" "$T" "$S" "$H" "$P" "$SH"
+done < "${FILEIN}" | tee /dev/stderr | sort -rnk1 -k2 | \
sed -r "s/^([0-9][0-9]*) /1(\1) /g;s/ [a-f0-9][a-f0-9]*$//g" |\
- sort -rk1 -k2
+ sort -rk1 -k2