Skip to content

Instantly share code, notes, and snippets.

@irenecasado
Last active January 31, 2022 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save irenecasado/92bee77c0a2579e773a6056509d4500a to your computer and use it in GitHub Desktop.
Save irenecasado/92bee77c0a2579e773a6056509d4500a to your computer and use it in GitHub Desktop.
ca_failed_banks.sh
mkdir -p
cd code
curl -s --output banklist.csv https://www.fdic.gov/resources/resolutions/bank-failures/failed-bank-list/banklist.csv
touch ca_failed_banks.csv
head -1 banklist.csv
head -1 banklist.csv > ca_failed_banks.csv
cat ca_failed_banks.csv
grep CA banklist.csv >> ca_failed_banks.csv
ROW_COUNT=`wc -l < ca_failed_banks.csv | xargs`
NUM_BANKS=$(($ROW_COUNT - 1))
echo "There are ${NUM_BANKS} failed banks in California"
# There are 41 failed banks in California.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment