카운터
발행: (2026년 1월 13일 오전 12:17 GMT+9)
1 min read
원문: Dev.to
Source: Dev.to
카운터 스크립트
mkfifo counter.fifo
(
t=0
b=0
while read cmd; do
case "$cmd" in
inc_t) ((t++)) ;;
inc_b) ((b++)) ;;
get) echo "$t $b" ;;
esac
done counter.fifo
echo ""
echo "Dumping table $tableName"
echo ""
bcpOUTToDir "$tableName"
if [ $? -ne 0 ]; then
echo inc_b > counter.fifo
echo "ERROR: BCP OUT command failed for table $tableName"
fi
) &
proceedWhenLessThanMaxJobs
done counter.fifo
read t b < counter.fifo
echo "Total tables: $t"
echo "Failures: $b"
kill "$COUNTER_PID"
rm counter.fifo