The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
get_source[34]: 0403-057 Syntax error at line 66 : `"' is not matched. vishal_ranjan Shell Programming and Scripting 1 05-15-2008 07:48 AM
I got error like...syntax error on line 1, teletype koti_rama UNIX for Advanced & Expert Users 2 07-07-2007 08:35 PM
getting error 0403-016 Cannot find or open the file while reading a long line karthee Shell Programming and Scripting 2 06-05-2005 01:00 AM
sh: syntax error at line 1: `>' unexpected atiato High Level Programming 2 03-16-2004 07:39 AM
syntax error on line 1, teletype KokoPops Shell Programming and Scripting 1 07-07-2002 10:33 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-19-2005
OMONI OMONI is offline
Registered User
  
 

Join Date: Jul 2005
Posts: 2
Smile 0403-057 Syntax error at line 70. pls help

Hi All,
I got a script from one of the unix forums for reporting on filesystem usage and wanted to use it but it keeps giving me the following error.

0403-057 Syntax error at line 70

The script is shown below.
Pls help as I am new to UNIX.

# set -x
# D I S K S P A C E . S H
#
# 07/02/96
#
# Checks available disk space against a reference table,
# and flags the filesystems that are below their limit.
#

# 10/12/94 Original Version
# 03/06/96 Minor modifications for HP/UX 10.0
# 07/02/96 Fixes to handle multi-line df -k lines better


TABLE=/home/ora9/scripts/diskspace.tab
BOLD=`tput smso`
NORM=`tput rmso`

if [ ! -f $TABLE ]
then TABLE=/home/ora9/scripts/diskspace.tab
echo "Using Table file : "$TABLE
fi

echo "\n\n\n% Used\tWarn\tFilesystem Name\t\t\tCURRENT DISKSPACE STATUS"
echo---"

df -k | while read LINE
do
set x ${LINE}
if [ -n "$3" ] # If $3 is null, suspect multiline fs
then
shift 5
else
read LINE
set x ${LINE}
shift 4
fi

if [ -n "$1" -a "$1" != "used" ]
then
PERCENT=`echo $1 | tr -d '%'`
FILESYSTEM=$2

set x `grep "^${FILESYSTEM} " ${TABLE}` # tab aftr FS
if [ -z "$3" ]
then
continue
fi
MAX=$3
ALARM=$4
if [ -z "$4" ]
then
ALARM=100
fi
if [ ${PERCENT} -gt $MAX ]
then
HDR=${BOLD}
TRL=${NORM}
if [ ${PERCENT} -gt $ALARM ]
then
TRL="$TRL\t\t\t\t*** CRITICAL ***"
else
TRL="$TRL\t\t\t\t*** WARNING ***"
fi
else
HDR=""
TRL=""
fi

echo "${PERCENT}%\t(${MAX}%)\t${HDR}${FILESYSTEM}${TRL}"
fi
done

echo "\n"
exit 0
--------End of DISKSPACE.SH

Thanks
T
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:47 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0