This file contains 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
# CLI Drill 2 | |
# ===== Pipes ===== | |
# Question 1 | |
echo "Downloading file..." | |
wget https://raw.githubusercontent.com/bobdeng/owlreader/master/ERead/assets/books/Harry%20Potter%20and%20the%20Goblet%20of%20Fire.txt 2> log.txt -O book.txt | |
# Question 2 | |
echo -e "\n\nTop 3 lines" | |
head -n 3 book.txt |
This file contains 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
# Question 1 | |
mkdir hello | |
cd hello | |
mkdir five one | |
cd five | |
mkdir six | |
cd six | |
touch c.txt | |
mkdir seven | |
cd seven |
This file contains 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
#!/usr/bin/python | |
import json | |
import requests | |
import sys | |
def check_weather(city): | |
api_key = "34b68bf9f7b70bfa195f3b34c58573c1" |
This file contains 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
#!/bin/bash | |
echo "Changing permissions..." | |
for entry in "$search_dir"./* | |
do | |
if [[ "$entry" == *.sh ]]; then | |
continue | |
elif [[ -d $entry ]]; then | |
chmod 755 $entry |