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 > Shell Programming and Scripting
.
google unix.com



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

 
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 08-09-2007
ibroxy ibroxy is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 19
: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
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 09:52 PM.


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