Skip to content

Connor_Shirley Submission#2

Open
DevinLayneShirley wants to merge 10 commits into
mdoellma:masterfrom
hcconner:master
Open

Connor_Shirley Submission#2
DevinLayneShirley wants to merge 10 commits into
mdoellma:masterfrom
hcconner:master

Conversation

@DevinLayneShirley

Copy link
Copy Markdown

Connor_Shirley Submission

Comment thread gender.sh
@@ -0,0 +1,29 @@
# Takes wages.csv and...

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.

Excellently commented code! Could use more frequent/useful commit messages.

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.

3/3

Comment thread gender.sh

#Usage: bash gender.sh <filenameforoutput>
echo 'Unique gender and yearsexperience cominations saved to' $1
cat wages.csv | sed '1d'| cut -d, -f-1,2 | sort -ut"," -k1,1 -k2n,2 > "$1"

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.

correct

Comment thread gender.sh
echo 'lowest earner:'
cat wages.csv | grep -v gender | sed 'y/,/ /' | sort -k 4 -n -r | tail -n 1
echo 'number of females in the top 10 wage earners:'
cat wages.csv | grep -v gender | sed 'y/,/ /' | sort -k 4 -n -r | head -n 10 | grep female | wc -l

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.

Correct, but if you read the directions carefully, you should have deleted the years schooling column from the returned responses.

Comment thread gender.sh
echo 'number of females in the top 10 wage earners:'
cat wages.csv | grep -v gender | sed 'y/,/ /' | sort -k 4 -n -r | head -n 10 | grep female | wc -l

#demonstrates the effect of graduating college on minimum wage

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.

Kudos for the use of awk! If you read directions carefully, you should have returned minimum, not average wage, but OK.
Should have reported the difference with echo "$val2 - $val1" | bc, after saving college and high school wages to val1 and val2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants