1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Melbourne, Australia
    Rep Power

    Parsing directories

    I'm new to Unix but am trying to use awk to parse a directory to determine if the files in it are relevant.

    They are all named something like arch_1_xxx.arc where the xxx is a number.

    Can anyone offer me clues as to how to break up the file names?

    I thought I would `ls` the directory into a file and then parse the file...I've spent hours trying to work it out and well.....

    At the end of the process, I have to move relevant files to another location.
  2. #2
  3. Introspective
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Nov 2001
    London, UK
    Rep Power
    you can do all that with shell, grep and xargs:

    ls -al dirname | grep 'thing_to_match' | xargs command[code]

    probably not much help, but give us more info about what you're doing with these files and the answer is yours

    This is me: http://chris.uk.com

IMN logo majestic logo threadwatch logo seochat tools logo