Skip to content

Commit

Permalink
Use a function from Shellbase
Browse files Browse the repository at this point in the history
  • Loading branch information
rdavid committed May 2, 2023
1 parent a8c3e0b commit d4a35e4
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions app/pingo
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@
# vi:et lbr noet sw=2 ts=2 tw=79 wrap
# Copyright 2022-2023 David Rabkin
# Adds timestamps to the ping command output.
# shellcheck disable=SC3043 # Uses local variables.
# shellcheck disable=SC1091,SC2034 # File not following, appears unused.
readonly \
BASE_APP_VERSION=0.9.20230502 \
BASE_MIN_VERSION=0.9.20230501
BASE_APP_VERSION=0.9.20230503 \
BASE_MIN_VERSION=0.9.20230503
. base.sh

# Redirects input to tsout line by line.
totsout() {
local lne
while IFS= read -r lne; do tsout "$lne"; done
}

# Starting point.
[ $# -ge 1 ] || die Usage: pingo [network resource].
{ ping "$1" 2>&1 1>&3 3>&- | tologe; } 3>&1 1>&2 | totsout

0 comments on commit d4a35e4

Please sign in to comment.