<commit_before>for file in $1/*
do
	if ! [ -f $file ]
	then
		mkdir $file
	else
		if f=$( find "$2" -name "$file.gz" ) && (( stat-c %Y $f > stat-c %Y $file))
		then
			cat $1/$file | gzip -c > $f
		fi
	fi
done
		<commit_msg>81187: commented and graded the additional shell script task<commit_after>#!/bin/bash

for file in $1/*
do
	if ! [ -f $file ]
	then
		mkdir $file
	else
        #   `stat -c`, not `stat-c`.  (-0.1)
        #   Also, the `stat` commands have to be wrapped in a subshell
        # subtitution.  (-0.1)
        #   The whole subtree should be checked instead of only the basename.
        # (-0.2)
        #   The `find` condition should be a bit different.  Like this:  (-0.2)
		#if ! [ -f "$2/$file.gz" ] || (( stat-c %Y $2/$file.gz < stat-c %Y $file))
		if f=$( find "$2" -name "$file.gz" ) && (( stat-c %Y $f > stat-c %Y $file))
		then
		    #   `gzip -c $1/$file > $f` is more concise.
            # Also, `$f` might be empty if the file was not found.  (-0.1)
			cat $1/$file | gzip -c > $f
		fi
	fi
done

# Total points for this task:  0.3/1
{'fraction_non_alphanumeric': 0.17134831460674158, 'fraction_numerical': 0.025280898876404494, 'mean_word_length': 2.0630372492836675, 'pattern_counts': {'":': 0, '<': 4, '<?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': '3359220', 'n_tokens_mistral': 444, 'n_tokens_neox': 418, 'n_words': 150}