![]() |
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 |
| PING - Unknown host 127.0.0.1, Unknown host localhost - Solaris 10 | Przemek | SUN Solaris | 4 | 05-26-2008 12:11 AM |
| TAHI Test Suite 3.0.13 (IPv6 Conformance Test Tool branch) | iBot | Software Releases - RSS News | 0 | 04-06-2008 12:20 PM |
| Or operator with if | babom | HP-UX | 1 | 10-03-2007 03:56 PM |
| Keithley Introduces Linux-Based RF Parametric Test Systems - Test and Measurement.com | iBot | UNIX and Linux RSS News | 0 | 07-23-2007 10:30 AM |
| And operator | rcarnesiii | Shell Programming and Scripting | 4 | 08-04-2005 02:04 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
:0: unknown test operator
I have gotten the script up to this point and it works fine a system but when i copy it to another unix server running solaris 9 as the original one , its gives an error './mon_fs.sh[18]: 0: unknown test operator' .
(see script bellow) can the Gurus see to this as i am just a beginner with scripting. ------------------------------------------------------------------------ #!/bin/ksh #se: Check to see if file systems are filling up # Usage: Execute from crontab # Dependencies: mon_fs.dat # Outputs: unix-ops@alibaba.com #***************************************************** # 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=unix-ops@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: $SRVNM 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 ------------------------------------------------------------------------ |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|