Skip to content

Instantly share code, notes, and snippets.

@aih
Last active January 30, 2023 14:44
Show Gist options
  • Save aih/ee93f0f460a36f20fd3b6659843977da to your computer and use it in GitHub Desktop.
Save aih/ee93f0f460a36f20fd3b6659843977da to your computer and use it in GitHub Desktop.
Finds files that are created with an -extracted.json ending, but not a -fullresults.json ending
#!/bin/bash
# Get list of files ending with -extracted.json
files_extracted=$(ls *-extracted.json)
# Use for loop to iterate over list of files ending with -extracted.json
for file in $files_extracted; do
# Check if file with -fullresults.json ending exists
if [ ! -f ${file%-extracted.json}-fullresults.json ]; then
# Print the filename if it doesn't exist
echo ${file%-extracted.json}
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment