In: Computer Science
Once you are in the Linux environment, perform the following steps:
For this submission, you will write a BASH shell program that meets the following requirements:
Setting the environment variable $USER with the export command:
The script bashscript.sh is mentioned below. The important commands used in the script are:
#!/bin/bash
clear
echo "########################################"
echo "This script will start now.."
echo "It will show the current user,"
echo "the system uptime, and the current time"
echo "along with the system type and "
echo "processor architecture of the machine"
echo "########################################"
echo ""
echo "Hello" $USER
echo ""
echo "The script is run on the date:" `date +%F`
echo ""
echo "Your first name is:" `echo $USER | cut -f1 -d " "`
echo ""
echo "The system name is:" `uname -s` "and the processor type is: "
`uname -m`
echo ""
echo "The uptime of the system is:" `uptime`
echo ""
echo "GoodBye!!"
exit 1
The IDE screenshot is below:
Execution of the script after making it executable with
chmod + x bashscript.sh