Re: An AWK question

From: Jonathan Chen (jonc_at_chen.org.nz)
Date: 02/04/05

  • Next message: Doug Poland: "Re: Possibly OT: ports question/suggestion"
    Date: Sat, 5 Feb 2005 08:54:52 +1300
    To: antenneX <antennex@swbell.net>
    
    

    On Fri, Feb 04, 2005 at 01:14:57PM -0600, antenneX wrote:
    > ---> 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
    > ---------------------------------------------

    Just change the word "-gt" to "-lt".

    -- 
    Jonathan Chen <jonc@chen.org.nz>
    ----------------------------------------------------------------------
                            "Irrationality is the square root of all evil"
                                                      - Douglas Hofstadter
    _______________________________________________
    freebsd-questions@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
    

  • Next message: Doug Poland: "Re: Possibly OT: ports question/suggestion"

    Relevant Pages

    • Re: Modifying a record field value while not blocking it to others
      ... And of course again the record you are trying to modify has not to be 'open' ... someone opens that ID=12 record everything in it is locked. ... often add a script line which opens a random record if the file holds enough ... system where customers use Credits when renting items and get Credits ...
      (comp.databases.filemaker)
    • Re: modifying objects in ADAM ADSIEDIT
      ... which is the NetBIOS name I referred to. ... ' Prompt for NetBIOS name of object in AD. ... ' Prompt for the attribute to modify. ... How do I script this by just modifying ...
      (microsoft.public.windows.server.scripting)
    • Re: sus office updates
      ... You can modify the registry ... or you can script a change for MSI to add ... my "encrypted" product code for Office 2003 Professional is: ...
      (microsoft.public.sms.tools)
    • Re: Modifying a record field value while not blocking it to others
      ... And of course again the record you are trying to modify has not to be ... someone opens that ID=12 record everything in it is locked. ... often add a script line which opens a random record if the file holds ... system where customers use Credits when renting items and get Credits ...
      (comp.databases.filemaker)
    • Modifying Primary Key Values
      ... Let's suppose I have a table MyTable (A INT PRIMARY KEY, ... In this script I modify the A column /the primary key/. ... You understand that I cannot rely for that purpose on the A column /the ...
      (microsoft.public.sqlserver.programming)