diff --git a/movies2.txt b/movies2.txt new file mode 100644 index 0000000..41da911 --- /dev/null +++ b/movies2.txt @@ -0,0 +1,6 @@ +Interstellar +Inception +High School Musical +Incredibles +Princess Diaries +A Cinderella Story diff --git a/wagescript.txt b/wagescript.txt new file mode 100644 index 0000000..199cd4c --- /dev/null +++ b/wagescript.txt @@ -0,0 +1,23 @@ +#hello! here is our code + +#alex - 1 + +cat wages.csv | cut -d , -f 1,2 | sed 's/,/ /g' |sort -u | uniq -u > wages3.csv + +#jessica - 2 + +#gives sorted data, top earner and worst earner +echo "The gender, years experience and wage for the highest earner is" +cat wages.csv | cut -d , -f 1,2,4 | sort -t\, -nrk3 | head -n 1 + +echo "The gender, years experience and wage for the lowest earner is" +cat wages.csv | cut -d , -f 1,2,4 | sort -t\, -nrk3 | sed '2,3293d' | head -n 2 | tail -n 1 + +echo "The number of females in the top ten earners in this data set" +cat wages.csv | cut -d , -f 1,2,4 | sort -t\, -nrk3 | head -n 10 | egrep -c 'female' + +#question 3 +echo "The difference in wages between 16 and 12 year educations is" +val1=$(cat wages.csv | cut -d , -f 3,4 | sed 's/,/ /g' | egrep -w 16 | sort -n -k 2 | head -n 1 | cut -d " " -f 2) +val2=$(cat wages.csv | cut -d , -f 3,4 | sed 's/,/ /g' | egrep -w 12 | sort -n -k 2 | head -n 1 | cut -d " " -f 2) +echo $val1 - $val2 | bc