Evidence and provenance
Inspect supplied evidence without changing it, preserving filenames and source references.
Start with what you actually received
An investigation begins with evidence, not a verdict. Record which files you examined and keep the originals unchanged. A line count describes the input; it does not prove that the records are valid, complete or trustworthy. An empty export might mean no events, a collection failure, or the wrong filter.
Read filenames as data. while IFS= read -r name preserves leading spaces and backslashes; quoting "./evidence/$name" keeps spaces, wildcard characters and shell punctuation inside one argument. Never use for name in $(cat list.txt) for filenames, and never execute evidence with eval or source.
A deliberately small format
The supplied manifest contains trusted basenames, one per line, without slashes, tabs or newlines inside a name. This is a stated input contract, not a general solution for arbitrary filesystem names. Prefixing paths with ./ also prevents a dash at the start of a basename from becoming an option.
Use awk 'END {print NR+0}' to count records, including a final line without a newline. Check that each source exists before reading it. Write findings elsewhere and carry the source name forward so another analyst can reproduce the observation. All evidence in this course is fictional and stays inside the browser lab.
printf 'Source: %s\n' 'auth sample.txt'
awk 'END {printf "records=%d\n", NR}' './evidence/auth sample.txt'
Put it into practice.
Read evidence/list.txt in its given order. Its entries are trusted, nonempty basenames. Print a TSV header source<TAB>lines, then each basename and its record count. Count a final unterminated line, preserve spaces and Unicode, and leave the inputs unchanged. If a listed file is missing, exit nonzero and include Missing evidence on stderr.
See an explained solution
export LC_ALL=C
printf 'source\tlines\n'
while IFS= read -r name || [ -n "$name" ]; do
[ -f "./evidence/$name" ] || { printf 'Missing evidence: %s\n' "$name" >&2; exit 1; }
count=$(awk 'END {print NR+0}' "./evidence/$name") || exit 1
printf '%s\t%s\n' "$name" "$count"
done < evidence/list.txt
The loop reads each manifest entry literally and quotes its path. A file check makes missing evidence explicit, while awk counts records without editing the source. The output keeps provenance in the first column.