Module 4 - Assignment

Problem Statement: Write a script to echo the following message before installing httpd in the system. The message is “You are using the system as” Change the file permission and test the script.

  1. Using nano we create the script
nano install_httpd.sh

The contents of the script:

#!/bin/bash
 
# Echo the username
echo "You are using the system as $(whoami)"
 
# Install httpd
sudo apt update && sudo apt install -y httpd

I’m using Ubuntu

  1. Make the script executable
chmod +x install_httpd.sh

  1. Executing the script
./install_httpd.sh