<commit_before>#!/bin/bash
echo "starting sleep_loop.sh for command: " ${@}
"${@}" >& make.log &
pid=$!
echo "sleep_loop got pid" $pid
while :
do
    sleep 60s
    if kill -0 "$pid" 2>/dev/null; then
	echo ' ==== ' `date` ' ==== '
	tail -1 make.log
    elif wait "$pid"; then
	break          # exit loop.
    fi
done
echo 'exited loop '
exit 0<commit_msg>sleep_loop.sh stops on command errors<commit_after>#!/bin/bash
rm -f make.log
echo "starting sleep_loop.sh for command: " ${@}
"${@}" >& make.log &
pid=$!
echo "sleep_loop got pid" $pid
ps -p "$pid" > /dev/null

if  [[ "${?}" -ne 0 ]];
then
    echo ' job stopped ' "${?}"
    exit 1
else
    while :
    do
        if kill -0 "$pid" 2>/dev/null; then
            echo ' ==== ' `date` ' ==== '
            tail -1 make.log
        elif wait "$pid"; then
            break          # exit loop.
        fi
        sleep 60s
    done
    exit 0
fi
echo 'exited loop '
tail -1 make.log
{'fraction_non_alphanumeric': 0.17075773745997866, 'fraction_numerical': 0.016008537886873, 'mean_word_length': 2.0957095709570956, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5590929', 'n_tokens_mistral': 356, 'n_tokens_neox': 339, 'n_words': 108}