From owner-freebsd-questions@FreeBSD.ORG Fri Feb 4 19:14:59 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2A57016A4CE for ; Fri, 4 Feb 2005 19:14:59 +0000 (GMT) Received: from ylpvm43.prodigy.net (ylpvm43-ext.prodigy.net [207.115.57.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9EA6C43D1D for ; Fri, 4 Feb 2005 19:14:58 +0000 (GMT) (envelope-from antennex@swbell.net) Received: from SAGEAME (adsl-65-68-247-73.dsl.crchtx.swbell.net [65.68.247.73])j14JFA2Y002962 for ; Fri, 4 Feb 2005 14:15:11 -0500 Message-ID: <005c01c50aed$d105c3b0$0200000a@SAGEAME> From: "antenneX" To: Date: Fri, 4 Feb 2005 13:14:57 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Subject: An AWK question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: antenneX List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Feb 2005 19:14:59 -0000 ---> FBSD-4.10p2 I have a script that tells me when a mailbox exceeds 2MB. Using it for another purpose. how can I modify this script to tell me when a file is LESS than a certain size? --------------------------------------------- #!/bin/sh #AWK=/usr/bin/awk #FILE=/file/size/to/check #LS=/bin/ls #SIZE=2048 # (2048 = 2MB) #if [ `${LS} -s ${FILE} | ${AWK} '{ print $1 }'` -gt ${SIZE} ]; then # echo File ${FILE} is ABOVE normal | mail -s "Alert: Check the file" #fi --------------------------------------------- Thanks, and.... Best regards, Jack L. Stone