![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| suppressing an error message using the "ls" command | basher400 | UNIX for Dummies Questions & Answers | 5 | 01-14-2009 11:18 AM |
| Getting error "syntax error at line 78 : `<' unmatched" | sshah1001 | Shell Programming and Scripting | 1 | 05-08-2008 05:41 PM |
| awk Shell Script error : "Syntax Error : `Split' unexpected | Herry | UNIX for Dummies Questions & Answers | 2 | 03-17-2008 11:16 AM |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-20-2007 01:52 AM |
| unknown error message "sh: No: not found" | cindytucci | UNIX for Advanced & Expert Users | 2 | 07-26-2005 12:44 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
"syntax error at line 21 :'done' unexpected." error message"
I am trying to run the script bellow but its given me "syntax error at line 20 :'done' unexpected." error message"
can someone check to see if the script is ok? and correct me pls. Today is my first day with scripting. Gurus should pls help out #!/bin/ksh # Purpose: Check to see if file systems are filling up # Usage: Execute from crontab # Dependencies: mon_fs.dat #***************************************************** # The directory this script resides in ADMINDIR=/opt/admin/scripts # The next variable can be set for multiple addresses # (i.e.ibroxy71@sunguru.com) MAILADD= ops-Unix@alibaba.com # Define the hostname of the server SRVNM=`uname -n` while read -r FS MAXCAP do CAPACITY=`df -k $FS | grep -v avail | awk {'print $5'} | awk -F% {'print $1'}` if test $CAPACITY -gt $MAXCAP; then mail $MAILADD <<EOF From: $0 To: $MAILADD Subject: File System on $SRVNM $FS is at $CAPACITY% capacity on $SRVNM (Threshold is $MAXCAP%). `date` EOF fi done < $ADMINDIR/mon_fs.dat exit 0 |
|
||||
|
cannot open file
thanks for the input . but after editing the script and runing . it gave another error "./mon_fs.sh[26]: /mon_fs.dat: cannot open"
I don't know what could be the problem as i set the permission for this file (mon_fs.dat to 600). |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|