Question
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
$TIME_STAMP
$(system_info)
$(show_uptime)
$(drive_space)
$(home_space)