[HPADM] Re: SUMMARY: directory search script needed ... : UNCLASS

From: MuthuKumar (kmuthukumar_at_lycos.co.uk)
Date: 10/06/04

  • Next message: Whittemore, Dale: "[HPADM] C2 Auditing S/W for HP-UX?"
    To: "Goncheroski, Joseph J., OIG DoD" <jgonch@dodig.osd.mil>, <hpux-admin@dutchworks.nl>
    Date: Wed, 6 Oct 2004 18:36:56 +0530
    
    

    >
    > not much on scripting and in need of a script to search directory "/abc/xyz"
    > for filename "joesfile" and if it is found, store it's file size in a
    > variable "filesize".
    >
    > after struggling with punctuation, i used the following to take care of my
    > search need, where joesfile is always in directory /abc/xyz:
    >
    > filesize=$(ll /abc/xyz/joesfile | awk `{print $5}`)

    If a file named /abc/xyz/joesfile there only your file size will be there. Else it is none there.
    To make more efficient then,

    [[ -f /abc/xyz/joesfile ]] && filesize=$(ls -s /abc/xyz/joesfile | awk `{print $1}`)

    It will give the size when the file /abc/xyz/joesfile must be there. Else it will not assign file size there.

    Regards
    -Muthukumar

    ---
    ===============  It is a "Virus Free Mail" ===============
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.772 / Virus Database: 519 - Release Date: 10/1/2004 
    --
                 ---> Please post QUESTIONS and SUMMARIES only!! <---
            To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
           Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
     
     Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
                http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)
    

  • Next message: Whittemore, Dale: "[HPADM] C2 Auditing S/W for HP-UX?"

    Relevant Pages

    • Re: Hello everybody its me SPOILER
      ... I have a good support worker and I confessed today to her that I was coping fine with my daughter but felt I was struggling with everything else but she didnt really say anythng or offer me any help but thats typically social services for you. ... Don't give you help until you've actually lost the fucking plot and then they'll take your kid away into care and adopt them. ... I keep losing my concentration on everything and just want to cry and cry and cry and never stop crying but the tear won't come. ... I have done a few chores today but they've all been major efforts like climbing the biggest mountain when actually they're only small jobs. ...
      (uk.people.support.depression)
    • Re: Charitys and the credit crunch
      ... adverts on tv dont give the slightest fuck about *you* and they care not ... if you are struggling to pay even the most basic utility bills. ...
      (uk.media.tv.misc)
    • Re: Charitys and the credit crunch
      ... adverts on tv dont give the slightest fuck about *you* and they care not ... if you are struggling to pay even the most basic utility bills. ...
      (uk.media.tv.misc)
    • Re: I Ate Sydney Harbor Opera House
      ... capitalization and no one gives a flying fuck about punctuation except the anal retentive. ... That's an incorrect statement because I care and I know of several users of the Usenet who care very much indeed. ... Remember the famous case about a prisoner on death row who sent a plea for clemency on the eve of his execution? ... James Follett. ...
      (uk.local.surrey)
    • Re: Im trying to make a turned heated bird bath.
      ... Total lack of sentence ... >>structure, punctuation, and capitalization leads me to dismiss them as ... >>lazy brained people who either drink to much, or simply don't care. ...
      (rec.crafts.woodturning)