Skip to content

Commit

Permalink
Added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rep-movsd committed Dec 21, 2018
1 parent f7a7ba8 commit 99305e5
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Lesson04/Exercise 18/Exercise 18.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Make sure you are in the ~/Lesson4 folder

# Step 1 to 3 - write following script (all the lines upto but not including Step 4) and save to pgn_extract1.sh
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable


#!/usr/bin/env bash
regex_blank="^[[:space:]]*$"
Expand Down
1 change: 1 addition & 0 deletions Lesson04/Exercise 19/Exercise 19.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function read_chunk()


# Step 2 to 6 - Write script and save to pgn_extract2.sh
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable


# Step 7
Expand Down
2 changes: 2 additions & 0 deletions Lesson04/Exercise 20/Exercise 20.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@


# Step 1 to 3 - Write script and save to pgn_extract3.sh
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable


# Step 4
Expand All @@ -24,6 +25,7 @@


# Step 6 & 7 - Modify pgn_extract3.sh by adding the following and save as pgn_extract4.sh
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable

function show_nth_game()
{
Expand Down
10 changes: 10 additions & 0 deletions Lesson04/Exercise 21/Exercise 21.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@


# Step 1 to 2 - Write following function in editor, save as pgn_extract5.sh
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable


function filter_game()
{
Expand Down Expand Up @@ -39,6 +41,8 @@ done


# Step 6 to 8 - save following code as pgn_extract6.sh
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable

function read_moves()
{
moves=''
Expand All @@ -63,6 +67,8 @@ echo "$moves"


# Step 10 to 11 - Add following code to pgn_extract6.sh and save as pgn_extract7.sh
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable


function count_moves()
{
Expand All @@ -85,6 +91,8 @@ done


# Step 13 to 22 - Add following code to pgn_extract7.sh and save as pgn_extract8.sh
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable

function filter_game()
{
# Initially assume not found
Expand Down Expand Up @@ -125,6 +133,8 @@ function show_games_won_in()


# Step 25 - Combine pgn_extract4.sh and pgn_extract8.sh into pgn_extract_final.sh
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable

./pgn_extract_final.sh -m 8 <games.pgn
./pgn_extract_final.sh -n 231 <games.pgn

Expand Down
18 changes: 13 additions & 5 deletions Lesson04/Exercise 22/Exercise 22.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,18 @@ trip_duration '2017-10-10 12:00:00' '2017-10-10 00:00:00'


# Step 6 - Edit the last line of the above function as the following and save it as taxi1.sh
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable

echo $(( ((n_stop - n_start) + 86400) % 86400 ))


# Step 7
./taxi1.sh '2017-10-10 12:00:00' '2017-10-10 00:00:00'


# Step 8 - No typing
# Step 8 - Create the taxi2.sh script as per the lesson
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable



# Step 9
Expand All @@ -46,28 +50,32 @@ head -n5 nyc_taxi.csv
./taxi2.sh <nyc_taxi.csv | head -n10


# Step 10 - No typing
# Step 10 - Create the taxi3.sh script by modifying taxi2.sh as per the lesson
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable


# Step 11
./taxi3.sh <nyc_taxi.csv | head -n10


# Step 12 - No typing
# Step 12 - Create the taxi4.sh script as per the lesson
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable


# Step 13
time head -n5000 nyc_taxi.csv | ./taxi4.sh >test.txt


# Step 14 - No typing
# Step 14 - Create the taxi5.sh script as per the lesson
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable


# Step 15
time head -n5000 nyc_taxi.csv | ./taxi5.sh >test.txt


# Step 16, 17 - No typing
# Step 16, 17 - Create the taxi6.sh script as per the lesson
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable


# Step 18
Expand Down
3 changes: 2 additions & 1 deletion Lesson04/Exercise 23/Exercise 23.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
head -n5 test.txt


#Step 2 to 5 - No Typing
#Step 2 to 5 - Create the taxi7.sh script as per the lesson
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable


# Step 6
Expand Down
3 changes: 2 additions & 1 deletion Lesson04/Exercise 24/Exercise 24.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Taxi Trip Analysis - Calculating Fare
# Make sure you are in the ~/Lesson4 folder

# Step 1,3 - Create the taxi8.sh script as per lesson
# Step 1,3 - Create the taxi8.sh script as per lesson -
# Before moving to the next step, remember to run the command chmod u+x on it to make it executable


# Step 4
Expand Down

0 comments on commit 99305e5

Please sign in to comment.