Sponsored Content
Top Forums Shell Programming and Scripting AIX 6.1 Error: 0403-053 Expression is not complete; more tokens expected. Post 302806447 by nitinkatipn on Monday 13th of May 2013 05:32:04 AM
Old 05-13-2013
AIX 6.1 Error: 0403-053 Expression is not complete; more tokens expected.

Hi
I have been trying every possible solution available for this error on this Forum but could not resolve it.

When i am running the below script i get this error.Smilie

sh diskMonitor.sh
diskMonitor.sh[23]: -: 0403-053 Expression is not complete; more tokens expected.
diskMonitor.sh[23]: -: 0403-053 Expression is not complete; more tokens expected.

The Verison of Unix is : AIX 6.1

The Script is to monitor disk space and send alert mail.

Code is :

Code:
#!/usr/bin/ksh
#This script monitors available disk space.
# This script emails an alert when a locally mounted partition crosses a given threshold.
# Set your threshold percentage (do not include the % sign), email address, and excluded mount points, then add to crontab
#
# Add this to crontab -e for root
# Diskspace monitoring script
#0 6 * * 1-5 /bin/diskMonitor.sh >/dev/null 2>&1

THRESHOLD="99"
EMAIL="abe@atred.com"
HOSTNAME=`hostname`

# Excluded mount points *must* be pipe delimited
# "/proc|/export/home|Mounted" should always be included

EXCLUDE="/proc|/export/home|Mounted"

df -k | awk '{print $7"\t"$4}' |egrep -v "(${EXCLUDE})" | while read LINE; do
PERC=`echo $LINE |awk '{print $2}' | cut -d"%" -f1`
Path=`echo $LINE |awk '{print $1}'`

if [ $PERC -gt THRESHOLD ];
then
echo "*****ALERT on $HOSTNAME Disk Space Exceeded the Threashold.Current Usage is  ${PERC}% on path  ${Path} Please perform C
lean Up*****" | /usr/bin/mailx -r xrt@avft.com -s "ALERT `hostname`: Disk Space Alert: ${LINE} used " $EMAIL
fi
done

---------- Post updated at 04:32 AM ---------- Previous update was at 04:26 AM ----------

FYI

The Script is working and sending mail. Its doing what it should but with these two o/p error message which i want to get rid of ASAP so i can cron them.

Last edited by Franklin52; 05-13-2013 at 06:34 AM.. Reason: Please use code tags for data and code samples
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

: + : more tokens expected

Hello- Trying to add two numbers in a ksh shell scripts and i get this error every time I execute stat1_ex.ksh: + : more tokens expected stat1=`cat .stat1a.tmp | cut -f2 -d" "` stat2=`cat .stat2a.tmp | cut -f2 -d" "` j=$(($stat1 + $stat2)) # < Here a the like the errors out echo $j... (3 Replies)
Discussion started by: Nomaad
3 Replies

2. Shell Programming and Scripting

0403-057 Syntax error at line 52 : `)' is not expected.

Can someone please tell me wht is wrong with the following peice of code? I keep getting the following error - 0403-057 Syntax error at line 52 : `)' is not expected. case "${option_count}" in 1) java -Xms256m -Xmx1536m "${APPLNAME}" "${ACTION_TYPE}" > "${LOGFILE}" 2>... (2 Replies)
Discussion started by: Veenak15
2 Replies

3. Shell Programming and Scripting

Script - Expression not complete more tokens expected

I have the following script to output a report of response times - but it is throwing the error: ./jobname: -: 0403-053 Expression is not complete; more tokens expected. Here is the code, any ideas what the problem is? (line 46 is simply, LC=0) FILE2=/templogs/access_log... (9 Replies)
Discussion started by: daveaasmith
9 Replies

4. Shell Programming and Scripting

Receiving error: ./ang.ksh[35]: 0403-057 Syntax error at line 116 : `done' is not expected.

Hi All I am quite new to Unix. Following is a shell script that i have written and getting the subject mentioned error. #!/bin/ksh #------------------------------------------------------------------------- # File: ang_stdnld.ksh # # Desc: UNIX shell script to extract Store information.... (3 Replies)
Discussion started by: amitsinha
3 Replies

5. Shell Programming and Scripting

+: more tokens expected

Hey everyone, i needed some help with this one. We move into a new file system (which should be the same as the previous one, other than the name directory has changed) and the script worked fine in the old file system and not the new. I'm trying to add the results from one with another but i'm... (4 Replies)
Discussion started by: senormarquez
4 Replies

6. Shell Programming and Scripting

ksh: 0403-057 Syntax error: `done' is not expected.

Hi I am getting error 'ksh: 0403-057 Syntax error: `done' is not expected.' when running below script any one can provide inputs on this. ------------------------ if then echo "Report Name |Modification Date|Report File Size|Owner" >SOX_`date +'%Y%m%d'` while read line do... (2 Replies)
Discussion started by: karnatis
2 Replies

7. Shell Programming and Scripting

0403-057 Syntax error at line : `}' is not expected.

i dont know where m i mistaking.. please help me out with this issue :( thanks in advance:rolleyes: one_main() { a=100 while ; do clear echo "##############################################" echo ":: CURRENTLY YOU ARE IN RC AND OC MARKING ::" echo... (1 Reply)
Discussion started by: Puneet sinha
1 Replies

8. AIX

0403-057 Syntax error at line 17 : `(' is not expected.

Hi, I am new to shell scripting.i am trying to mail after my backup completed. Here is my shell script: if ; then egrep (ERROR|error|Error|RMAN-) ${/backup/RMANBKUP/spool/shelltest.log} > /dev/null if ; then RESULT_MSG=WARNING: Errors occurred during the ${ORACLE_SID} Rman... (3 Replies)
Discussion started by: faruqms
3 Replies

9. Shell Programming and Scripting

Getting error -: more tokens expected in shell script

Hi can someone help me to resolve the error for this condition if ] && ]; then i am passing the values $k and $kkm i am getting the error like "-: more tokens expected" Thanks in Advance (5 Replies)
Discussion started by: makigate
5 Replies

10. Shell Programming and Scripting

0403-057 Syntax error at line 17 : `(' is not expected.

Hi, While executing my code i am getting below Error: ./check_disk1: 0403-057 Syntax error at line 55 : `(' is not expected. My code is : #!/bin/ksh PROGNAME=`basename $0` STATE_OK=0 STATE_WARNING=1 STATE_CRITICAL=2 STATE_UNKNOWN=3 OS=$(uname) AWK="/usr/bin/awk"... (6 Replies)
Discussion started by: abodage
6 Replies
getopt(1)						      General Commands Manual							 getopt(1)

NAME
getopt - Parses command line flags and arguments SYNOPSIS
getopt format tokens DESCRIPTION
The getopt command is used to parse a list of tokens using a format that specifies expected flags and arguments. A flag is a single ASCII letter and, when followed by a : (colon), is expected to take a modifying argument that may or may not be separated from it by one or more tabs or spaces. (You can include multi-byte characters in arguments, but not as flag letters.) The getopt command completes processing when it has read all tokens or when it encounters the special token -- (double dash). It then out- puts the processed flags, a --, and any remaining tokens. If a token fails to match a flag, getopt writes a message to standard error. NOTES
In the csh, use the following command to run getopt: set argv=`getopt flag_string $*` EXAMPLES
The following is an example of the use of getopt in a skeleton shell script to parse options: #!/bin/sh # parse command line into arguments set -- `getopt a:bc $*` # check result of parsing if [ $? != 0 ] then exit 1 fi while [ $1 != -- ] do case $1 in -a) # set up the -a flag AFLG=1 AARG=$2 shift;; -b) # set up the -b flag BFLG=1;; -c) # set up the -c flag CFLG=1;; esac shift # next flag done shift # skip double dash # now do the work . . . The following are all equivalent arguments to the script: -a ARG -b -c -- A B C -a ARG -bc -- A B C -aARG -b -c -- A B C -b -c -a ARG -- A B C SEE ALSO
Commands: sh(1) Functions: getopt(3) getopt(1)
All times are GMT -4. The time now is 01:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy