- How to create SSH keys
- What is the advantage of using
#!/usr/bin/env bash
over#!/bin/bash
- How to use
while
,until
andfor
loops - How to use
if
,else
,elif
andcase
condition statements - How to use the
cut
command - What are files and other comparison operators, and how to use them
- Allowed editors: vi, vim, emacs
- All your files will be interpreted on Ubuntu 20.04 LTS
- All your files should end with a new line
- A README.md file, at the root of the folder of the project, is mandatory
- All your Bash script files must be executable
- You are not allowed to use awk
- Your Bash script must pass Shellcheck (version 0.7.0) without any error
- The first line of all your Bash scripts should be exactly #!/usr/bin/env bash
- The second line of all your Bash scripts should be a comment explaining
- what is the script doing
In this project, I was able to complete the following tasks:
Share your public key in your answer file 0-RSA_public_key.pub
Write a Bash script that displays Best School
10 times.
Requirement:
- You must use the
for
loop (while
anduntil
are forbidden)
Write a Bash script that displays Best School
10 times.
Requirements:
- You must use the
while
loop (for
anduntil
are forbidden)
Write a Bash script that displays Best School
10 times.
Requirements:
- You must use the
until
loop (for
andwhile
are forbidden)
Write a Bash script that displays Best School
10 times, but for the 9th
iteration, displays Best School
and then Hi
on a new line.
Requirements:
- You must use the while loop (for and until are forbidden)
- You must use the if statement
Write a Bash script that loops from 1 to 10 and:
- displays
bad luck
for the 4th loop iteration - displays
good luck
for the 8th loop iteration - displays
Best School
for the other iterations
Requirements:
- You must use the
while
loop (for
anduntil
are forbidden) - You must use the
if
,elif
andelse
statements
Write a Bash script that displays numbers from 1 to 20 and:
- displays
4
and thenbad luck from China
for the 4th loop iteration - displays
9
and thenbad luck from Japan
for the 9th loop iteration - displays
17
and thenbad luck from Italy
for the 17th loop iteration
Requirements:
You must use the while
loop (for
and until
are forbidden)
You must use the case
statement
Write a Bash script that displays the time for 12 hours and 59 minutes:
- display hours from 0 to 12
- display minutes from 1 to 59
Requirements:
- You must use the
while
loop (for
anduntil
are forbidden)
Write a Bash script that displays:
- The content of the current directory
- In a list format
- Where only the part of the name after the first dash is displayed
Requirements:
- You must use the for loop (while and until are forbidden)
- Do not display hidden files
Write a Bash script that gives you information about the school file.
Requirements:
- You must use
if
and,else
(case
is forbidden) - Your Bash script should check if the file exists and print:
- if the file exists:
school file exists
- if the file does not exist:
school file does not exist
- if the file exists:
- If the file exists, print:
- if the file is empty:
school file is empty
- if the file is not empty:
school file is not empty
- if the file is a regular file:
school is a regular file
- if the file is not a regular file: (nothing)
- if the file is empty:
Write a Bash script that displays numbers from 1 to 100.
Requirements:
- Displays
FizzBuzz
when the number is a multiple of 3 and 5 - Displays
Fizz
when the number is multiple of 3 - Displays
Buzz
when the number is a multiple of 5 - Otherwise, displays the number
- In a list format
help: read
Write a Bash script that displays the content of the file /etc/passwd
.
Your script should only display:
-
username
-
user id
-
Home directory path for the user Requirements:
-
You must use the
while
loop (for
anduntil
are forbidden)