-
Notifications
You must be signed in to change notification settings - Fork 9
mccown-midlige submission #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pjlmac
wants to merge
18
commits into
lyy005:master
Choose a base branch
from
pjlmac:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d3b99b3
Abbies favoirte movies
7b2cffb
Phil's Movies
pjlmac ce2e02e
Phil's Movies Ranked
pjlmac 86fe7dc
Abbies ranking
b4025d1
Final Ranking
6949c4f
Part 1
pjlmac 231fffa
About halfway done with 4C
pjlmac 6713a91
Update Exercise4.sh
pjlmac d47b5ab
Trial and error fixing failed :(
pjlmac a62e23b
Fixed Repeat Problem, now we need to subtract output
pjlmac 16e7d7c
No change
pjlmac d3fcd00
Fixed an attempted solution that didn't work
pjlmac 1a3cf4a
Shell script that is the answer for 4C
pjlmac cf009ad
Shell Script for Question 4B
b6671bc
Renamed Exercise4.sh to Exercise4A.sh
pjlmac 9b6923f
Delete Exercise4.sh
pjlmac 66fced2
Delete Wages1.txt
pjlmac e48f39e
Accidentally purged Wages1.txt file
pjlmac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| grep -w "female" wages.csv | cut -d , -f1,2 | tr ',' ' ' | sort -n -k2 | uniq >> Wages1.txt | ||
| grep -w "male" wages.csv | cut -d , -f1,2 | tr ',' ' ' | sort -n -k2 | uniq >> Wages1.txt | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #for input, go with the higher numbered term first and only using the format gender,yearsOfschooling, for example, "male,16" or "female,16" | ||
| a=$(cut -d , -f1,3,4 wages.csv | grep -we "$1" | cut -d , -f3 | sort -rn | tail -n 1) | ||
| b=$(cut -d , -f1,3,4 wages.csv | grep -we "$2" | cut -d , -f3 | sort -rn | tail -n 1) | ||
| echo "$a-$b" | bc | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| female 1 | ||
| female 2 | ||
| female 3 | ||
| female 4 | ||
| female 5 | ||
| female 6 | ||
| female 7 | ||
| female 8 | ||
| female 9 | ||
| female 10 | ||
| female 11 | ||
| female 12 | ||
| female 13 | ||
| female 14 | ||
| female 15 | ||
| female 16 | ||
| male 2 | ||
| male 3 | ||
| male 4 | ||
| male 5 | ||
| male 6 | ||
| male 7 | ||
| male 8 | ||
| male 9 | ||
| male 10 | ||
| male 11 | ||
| male 12 | ||
| male 13 | ||
| male 14 | ||
| male 15 | ||
| male 16 | ||
| male 17 | ||
| male 18 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #To return the gender, yearsExperience, and wage of the lowest earner to stdout | ||
|
|
||
| #To return the genfer, yearsExperience, and wage of the lowest earner to stdout | ||
|
|
||
| #To return number of female wage earners to stdout | ||
|
|
||
| var1=$(cat $filename | sort -k4 -n | cut -d ',' -f1,2,4 | head -n 2 | tail -n 1) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sort doesn't work with csv format. You may want to replace "," with " " first: -0.25 point |
||
| var2=$(cat $filename | sort -k4 -n -g | cut -d ',' -f1,2,4 | tail -n 1) | ||
| var3=$(cat $filename | sort -k4 -n -g | cut -d ',' -f1,2,4 | tail -n 10| grep -w "female" | wc -l) | ||
| echo $var1 $var2 $var3 | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Good Will Hunting | ||
| Shawshank Redemption | ||
| Interstellar | ||
| Godfather 1/2 | ||
| Remember the Titans | ||
| Elf | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, you can sort by the first column and then the second column with command sort:
sort -k1,1d -k2,2n