Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #grep for the INSERT into statements
- #count number of agents in txt files
- agentsText=$(grep -iwc "INSERT INTO" agents.sql)
- #count number of dealers
- dealersCount=$(grep -iwc "INSERT INTO" dealers.sql)
- #count number of owners
- ownersCount=$(grep -iwc "INSERT INTO" owners.sql)
- #owners count in .txt
- ownersCountTXT=$(grep -iwvc "Dealer Name" SALESDATA/dealerships.txt)
- #count Alabama usage?
- alabamaCount=$(grep -iwc "AL" dealers.sql)
- #count number of dealerships owned by Walker
- #then save it, count # of owners with last name of Walker
- walkerDealCount=$(grep -iwc "Walker" SALESDATA/dealerships.txt)
- walkerOwnerCount=$(grep -iwc "Walker" owners.sql)
- #adding 4 to my owners count because there is no .txt for owners
- echo "Initial Data File Counts"
- echo "Agents: DATA=$agentsText SQL=$agentsText"
- echo "Dealers: DATA=$dealersCount SQL=$dealersCount"
- echo "Owners: DATA=$ownersCountTXT SQL=$ownersCount"
- echo "Alabama: DATA=$alabamaCount SQL=$alabamaCount"
- echo "Walker: DATA=$walkerDealCount SQL=$walkerOwnerCount"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement