Skip to content

Instantly share code, notes, and snippets.

@ecatanzani
Created October 19, 2020 07:28
Show Gist options
  • Save ecatanzani/9ffc9424fa97ca1980e6fa0ffe5e5707 to your computer and use it in GitHub Desktop.
Save ecatanzani/9ffc9424fa97ca1980e6fa0ffe5e5707 to your computer and use it in GitHub Desktop.
Check empty files in list
#!/usr/bin/env bash
_LIST=$1
echo "Reading files in ${_LIST}"
while IFS="" read -r line || [ -n "${line}" ]
do
if [[ -s ${line} ]]; then echo "${line}: NOT EMPTY"; else echo "${line}: EMPTY"; fi
cat ${line} >> test_if_empty.txt
done < ${_LIST}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment