Skip to content

Chen-Buynak submission#5

Open
yunluyingying wants to merge 9 commits into
lyy005:masterfrom
yunluyingying:master
Open

Chen-Buynak submission#5
yunluyingying wants to merge 9 commits into
lyy005:masterfrom
yunluyingying:master

Conversation

@yunluyingying

Copy link
Copy Markdown

No description provided.

Comment thread exercise_4.sh
grep -E 'female|male' wages.csv|cut -d ',' -f 1,2,4|sed 's/,/ /g'|sort -k 3 -n|tail -n 10|grep -E 'female'|wc -l >> stdout.txt
#Question 3
echo "yearsExperience vs minimum_wage" >> stdout.txt
grep -E 'female|male' wages.csv|cut -d ',' -f 3,4|sed 's/,/ /g'|sort -k 1,1 -k 2,2n|sort -buk1,1|sed -n -e 3p -e 7p >> stdout.txt

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.

You can use the bc command for calculation:

minHS=$(cat wages.csv | cut -d "," -f 3,4 | tr "," " " | grep -w 12 | sort -n -k 2 | head -n 1 | cut -d " " -f 2)
minBS=$(cat wages.csv | cut -d "," -f 3,4 | tr "," " " | grep -w 16 | sort -n -k 2 | head -n 1 | cut -d " " -f 2)

echo "$minBS - $minHS" | bc

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