telegraf/plugins/inputs/execd/examples/count.sh

13 lines
190 B
Bash
Raw Normal View History

#!/bin/sh
2020-02-29 02:46:03 +08:00
## Example in bash using STDIN signaling
counter=0
while read -r _; do
2020-02-29 02:46:03 +08:00
echo "counter_bash count=${counter}"
counter=$((counter+1))
2020-02-29 02:46:03 +08:00
done
trap "echo terminate 1>&2" EXIT