File tree Expand file tree Collapse file tree 12 files changed +22
-57
lines changed
bash-scripting/exercises/grep-script
substitute-correct-user-data Expand file tree Collapse file tree 12 files changed +22
-57
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ weight: 105
66---
77
88## Script Requirements:
9- - Get Dataset located at ` https://launchcodetechnicaltraining .org/api/walkthrough/user?data_format=csv `
9+ - Get Dataset located at ` https://launchcodelearning .org/api/walkthrough/user?data_format=csv `
1010 - write it to a file called ` user-data ` in your ` home ` directory.
1111- Create a new directory called ` technical-user-data ` inside of the ` home directory `
1212- Filter the Data inside of ` user-data ` to include only lines matching ` Paul ` and write the results to a file called ` paul-data.csv ` inside of the ` technical-user-data ` directory
@@ -18,7 +18,7 @@ weight: 105
1818``` bash
1919#! /bin/bash
2020
21- curl -s https://launchcodetechnicaltraining .org/api/walkthrough/user? data_format=csv > ~ /user-data
21+ curl -s https://launchcodelearning .org/api/walkthrough/user? data_format=csv > ~ /user-data
2222
2323mkdir ~ /technical-user-data
2424
Original file line number Diff line number Diff line change @@ -4,6 +4,6 @@ The only dependancy for this class is that you have VirtualBox installed on your
44
55### Configurations
66
7- - [ Configurations Home] ( https://launchcodetechnicaltraining .org/linux/configurations/ )
8- - [ VirtualBox Download & Installation] ( https://launchcodetechnicaltraining .org/linux/configurations/virtualbox/ )
9- - [ Ubuntu Image in VirtualBox] ( https://launchcodetechnicaltraining .org/linux/configurations/ubuntu/ )
7+ - [ Configurations Home] ( https://launchcodelearning .org/linux/configurations/ )
8+ - [ VirtualBox Download & Installation] ( https://launchcodelearning .org/linux/configurations/virtualbox/ )
9+ - [ Ubuntu Image in VirtualBox] ( https://launchcodelearning .org/linux/configurations/ubuntu/ )
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ Using the user.csv Dataset complete the following requirements:
6262{{% notice note %}}
6363If you need to get the ` user.csv ` Dataset again you can do so with the following command:
6464``` bash
65- curl -s https://launchcodetechnicaltraining .org/api/walkthrough/user? data_format=csv > user.csv
65+ curl -s https://launchcodelearning .org/api/walkthrough/user? data_format=csv > user.csv
6666```
6767{{% /notice %}}
6868
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ Using the user.csv Dataset complete the following requirements:
3030{{% notice note %}}
3131If you need to get the ` user.csv ` Dataset again you can do so with the following command:
3232``` bash
33- curl -s https://launchcodetechnicaltraining .org/api/walkthrough/user? data_format=csv > user.csv
33+ curl -s https://launchcodelearning .org/api/walkthrough/user? data_format=csv > user.csv
3434```
3535{{% /notice %}}
3636
Original file line number Diff line number Diff line change @@ -35,14 +35,14 @@ Regular expressions can be:
3535Before we can start searching text we need to first download the text we will be searching. From your home directory:
3636
3737``` bash
38- curl -s https://launchcodetechnicaltraining .org/api/walkthrough/user? data_format=csv > user.csv
38+ curl -s https://launchcodelearning .org/api/walkthrough/user? data_format=csv > user.csv
3939```
4040
4141This command makes a ` curl ` request to the provided endpoint and whatever data is returned will be written to a file called ` user.csv ` .
4242
4343### Validation
4444
45- ![ curl -s https://launchcodetechnicaltraining .org/api/walkthrough/user?data_format=csv validation image] ( pictures/curl-dataset.png?classes=border )
45+ ![ curl -s https://launchcodelearning .org/api/walkthrough/user?data_format=csv validation image] ( pictures/curl-dataset.png?classes=border )
4646
4747You can ` cat ` out the file, but it has 25000 records in it.
4848
Original file line number Diff line number Diff line change @@ -9,13 +9,13 @@ hidden: true
99## At Least One, Possibly More ` + `
1010
1111``` bash
12- curl -s https://launchcodetechnicaltraining .org/api/walkthrough/transaction? data_format=csv | grep ' \$5[0-9]\+'
12+ curl -s https://launchcodelearning .org/api/walkthrough/transaction? data_format=csv | grep ' \$5[0-9]\+'
1313```
1414
1515## Maybe One, Possibly More ` * `
1616
1717``` bash
18- curl -s https://launchcodetechnicaltraining .org/api/walkthrough/user? data_format=csv | grep ' ^Paula*'
18+ curl -s https://launchcodelearning .org/api/walkthrough/user? data_format=csv | grep ' ^Paula*'
1919```
2020
2121## Match Exact Number ` {} `
@@ -54,13 +54,13 @@ echo -e "Paul\nPaula\nPaulaaaaaa\nTim" | grep '^Paula\{6\}$'
5454## Regular Expression Groups ` () `
5555
5656``` bash
57- curl -s https://launchcodetechnicaltraining .org/api/walkthrough/user? data_format=csv | grep ' \(Paul\|John\)'
57+ curl -s https://launchcodelearning .org/api/walkthrough/user? data_format=csv | grep ' \(Paul\|John\)'
5858```
5959
6060``` bash
61- curl -s https://launchcodetechnicaltraining .org/api/walkthrough/user? data_format=csv | grep ' ^\(Paul\|John\),'
61+ curl -s https://launchcodelearning .org/api/walkthrough/user? data_format=csv | grep ' ^\(Paul\|John\),'
6262```
6363
6464``` bash
65- curl -s https://launchcodetechnicaltraining .org/api/walkthrough/user? data_format=csv | grep ' \(Accenture\|Boeing|)$'
65+ curl -s https://launchcodelearning .org/api/walkthrough/user? data_format=csv | grep ' \(Accenture\|Boeing|)$'
6666```
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ We can even pass the output from a `grep` command to another `grep` command to b
1212### Step One: Get our Dataset
1313
1414``` bash
15- curl -s https://launchcodetechnicaltraining .org/api/walkthrough/user? data_format=csv
15+ curl -s https://launchcodelearning .org/api/walkthrough/user? data_format=csv
1616```
1717
1818Output:
@@ -26,7 +26,7 @@ Output:
2626Filter data to include only ` '^John' ` :
2727
2828``` bash
29- curl -s https://launchcodetechnicaltraining .org/api/walkthrough/user? data_format=csv | grep ' ^John,'
29+ curl -s https://launchcodelearning .org/api/walkthrough/user? data_format=csv | grep ' ^John,'
3030```
3131
3232Output:
@@ -38,7 +38,7 @@ Output:
3838Using the output from the previous filter, filter further to include lines that match ` 'Microsoft$' ` .
3939
4040``` bash
41- curl -s https://launchcodetechnicaltraining .org/api/walkthrough/user? data_format=csv | grep ' ^John,' | grep ' Microsoft$'
41+ curl -s https://launchcodelearning .org/api/walkthrough/user? data_format=csv | grep ' ^John,' | grep ' Microsoft$'
4242```
4343
4444Output:
@@ -50,7 +50,7 @@ Output:
5050Using the output from the previous filter, filter further to include lines that match ` '@example\.com' ` .
5151
5252``` bash
53- curl -s https://launchcodetechnicaltraining .org/api/walkthrough/user? data_format=csv | grep ' ^John,' | grep ' Microsoft$' | grep ' @example\.com'
53+ curl -s https://launchcodelearning .org/api/walkthrough/user? data_format=csv | grep ' ^John,' | grep ' Microsoft$' | grep ' @example\.com'
5454```
5555
5656Output:
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ Output:
5959Send a ` curl ` request directly to the API and match the results (` csv ` in ` STDIN ` ) to a specific pattern.
6060
6161``` bash
62- curl -s https://launchcodetechnicaltraining .org/api/walkthrough/user? data_format=csv | grep ' Microsoft$'
62+ curl -s https://launchcodelearning .org/api/walkthrough/user? data_format=csv | grep ' Microsoft$'
6363```
6464
6565Output:
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ This and the following articles use the `user-data.csv` file.
5757If you don't already have the ` user-data.csv ` file in your home directory run the following command:
5858
5959``` bash
60- curl -s https://launchcodetechnicaltraining .org/api/walkthrough/user? data_format=csv > ~ /user-data.csv
60+ curl -s https://launchcodelearning .org/api/walkthrough/user? data_format=csv > ~ /user-data.csv
6161```
6262
6363{{% notice green "Bonus" "rocket" %}}
You can’t perform that action at this time.
0 commit comments