Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

When running my linux script, it's stating I have two errors, and I'm not sure how to solve them. They are: 1. Line 39: unexpected

When running my linux script, it's stating I have two errors, and I'm not sure how to solve them. They are:

1. Line 39: unexpected EOF while looking for matching ' " '

2. Line 63: syntax error: unexpected end of file.

Below is my file:

TITLE=" ______ System Information for $HOSTNAME"

RIGHT_NOW=$(date +"%x %r %z")

TIME_STAMP="Updated on $RIGHT_NOW by $USER"

system_info()

{

echo "

System release info

"

echo "

Function not yet implemented

}

show_uptime()

{

echo "

System uptime

"

echo "

"

uptime

echo "

"

}

drive_space()

{

echo "

Filesystem space

"

echo "

"

df

echo "

"

}

function home_space

{

if [ "$(id -u)" != "0"; then

echo "You must be the superuser to run this script" >&2

exit 1

fi

if [ "$(id -u)" = "0" ]; then

echo "

Home directory space by user

"

echo "

"

echo "Bytes Directory"

du -s /home/* | sort -nr

echo "

"

fi

}

cat <<- _EOF_

$TITLE

$TITLE

$TIME_STAMP

$(system_info)

$(show_uptime)

$(drive_space)

$(home_space)

_EOF_

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions