Skip to content

Commit 89efe54

Browse files
committed
updated the assignment.sh file trial 1
1 parent 7a0d963 commit 89efe54

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

02_activities/assignments/assignment.sh

100644100755
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ set -x
1212
if [ -d newproject ]; then
1313
echo "Recreating the newproject directory"
1414
rm -rf newproject
15-
fi
15+
fi
1616
mkdir newproject
1717
cd newproject
1818

@@ -28,21 +28,30 @@ unzip -q rawdata.zip
2828
# Complete assignment here
2929

3030
# 1. Create a directory named data
31+
mkdir data
3132

3233
# 2. Move the ./rawdata directory to ./data/raw
34+
mv rawdata ./data/raw
3335

3436
# 3. List the contents of the ./data/raw directory
37+
ls ./data/raw
3538

3639
# 4. In ./data/processed, create the following directories: server_logs, user_logs, and event_logs
40+
mkdir ./data/processed
41+
mkdir ./data/processed/server_logs ./data/processed/user_logs ./data/processed/event_logs
3742

3843
# 5. Copy all server log files (files with "server" in the name AND a .log extension) from ./data/raw to ./data/processed/server_logs
44+
cp ./data/raw/*server*.log ./data/processed/server_logs
3945

4046
# 6. Repeat the above step for user logs and event logs
47+
cp ./data/raw/*user*.log ./data/processed/user_logs
48+
cp ./data/raw/*event*.log ./data/processed/event_logs
4149

4250
# 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs
51+
rm -f ./data/raw/*ipaddr* ./data/processed/user_logs/*ipaddr*
4352

4453
# 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed
45-
54+
ls -R ./data/processed > ./data/inventory.txt
4655

4756
###########################################
4857

0 commit comments

Comments
 (0)