Skip to content
Open
17 changes: 17 additions & 0 deletions exercise4challenge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# a script for determining gender and wages of highest and lowest earning workers.
# Also tells the number of females in the top 10 earners in the data sel
# Usage: bash part2.sh wages.csv

echo "information for lowest wage earner"
cat wages.csv | grep -v "gender" | tr "," " " | sort -n -k 4 | head -n 1 | cut -d " " -f 1,2,4
echo "information for highest wage earner"
cat wages.csv | grep -v "gender" | tr "," " " | sort -n -k 4 | tail -n 1 | cut -d " " -f 1,2,4
echo "number of females in the top ten earners"
cat wages.csv | tr "," " " | sort -n -k 4 | tail -n 10 | grep "female" | wc -l

# part 4 of challenge
# calculates difference between minimum wage of personw ith 16 years of school and 12 years of school
echo "diffrence of minimum wages for person with 12 years and 16 years school"
val1=$(cat wages.csv | tr "," " " | cut -d " " -f 3,4 | grep "12 " | sort -n -k 2 | head -n 1 | cut -d " " -f 2)
val2=$(cat wages.csv | tr "," " " | cut -d " " -f 3,4 | grep "16 " | sort -n -k 2 | head -n 1 | cut -d " " -f 2)
echo "$val2 - $val1" | bc

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job!

12 changes: 12 additions & 0 deletions favoritemovies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<<<<<<< HEAD
Howls Moving Castle
Kiki's Delivery Service
Spirited Away
The Little Mermaid
I Am Legend
A Beautiful Mind
=======
A Beautiful Mind
I Am Legend
The Little Mermaid
>>>>>>> c68b85d48397e22ac94f9a2b7b49a99131cff851
Loading