Free Essay SamplesAbout UsContact Us Order Now

Week 5 Individual Assignment

0 / 5. 0

Words: 550

Pages: 2

72

To:
From:
Date:
Linux Script 1
#!/bin/sh#Display the date
getDate(){
date return }
info=$(uname -a)
date=$(getDate)
user=$(id)
echo The Current Date is $date
echo Username and Id: $user
echo System Information: $info
echo Our Current Working Directory is $PWD
Output results are as shown below
centertop
Linux Script 2
#!/bin/bash
getDate(){
date return }
theDate=$(getDate)
info=$(uname -a)
user=$(id)
cd /tmp #search for ‘Mary’ in /etc/passwd name=’Mary’
search=$(grep $name /etc/passwd)
if [ $? -eq 0 ] then echo $name is a user in the system
else echo $name is not a user in the system
fi #display date
echo The Date is $theDate #display system information
echo System Information $info
#display user id
echo $user
#display current directory
echo Current Directory is $PWD
Output Source is as follows:
centertop
Linux Script 3
#! /bin/bash
getDate(){
date return }
hostname=$(hostname)
theDate=$(getDate)
args=(“$@”)
size=${#args[@]}
if [ “$size” -lt 2 ]
then echo You need to enter two arguments
exit 64
elif [ “$size” -gt 2 ]
then echo You need to enter two arguments
exit 64
elif [ “$size” -eq 2 ]
then echo ${args[1]} ${args[0]}
fi #display date
echo $theDate #display username
echo $USER
#display hostname
echo $hostname
Output is as follows:
251642-76352
Linux Script 4
#!/bin/bash
getDate(){
date return }
theDate=$(getDate)
users=$(who –count)
path=$PATH
echo a.

Wait! Week 5 Individual Assignment paper is just an example!

Windows
echo b. Linux
echo c. Mac OS
echo d. Chrome OS
read -p “Enter An Answer: ” choice
case $choice in
“a”) echo “Windows is the most popular OS in the world.”;;
“b”) echo “Linux is the preferred choice for most developers.”;;
“c”) echo “Mac OS is like a child of Windows and Linux :D.”;;
“d”) echo “An entry into the Os market. Seems to be promising.”;; *) echo “Please choose one of the options.”;; esac #Display The Current Date and Time
echo $theDate #Display The Number of Users
echo $users
#Display Path Files
echo $path
00
00
References
Siever, E., Weber, A., Figgins, S., Love, R., & Robbins, A. (2005). Linux in a Nutshell. ” O’Reilly Media, Inc.”.

Get quality help now

Top Writer

Alton Sloan

5.0 (251 reviews)

Recent reviews about this Writer

I have ordered a college case study from this company, and I’m on cloud nine! It is written in an extremely professional manner, doesn’t contain any mistakes, and is just perfect. Thank you for saving my grades!

View profile

Related Essays

History Thesis Proposal

Pages: 1

(550 words)

Legal Marijuana

Pages: 1

(550 words)

Political science Synthesis Essay

Pages: 1

(275 words)

Macbeth and the supernatural

Pages: 1

(275 words)

Mass incarceration

Pages: 1

(275 words)

Technology affect on society

Pages: 1

(550 words)

English Research paper

Pages: 1

(275 words)