Unix administration - find within a sh script

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > March 2005 > find within a sh script





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author find within a sh script
jdunphy

2005-03-09, 5:57 pm

i am currently doing this
HEAP=`/usr/bin/find / -type f -name heap*.phd -newer $JOB_MARK -print
2>/dev/null`

i now have a new requirment to find 3 different files. i'd like to keep
it very very simple so if i could change heap*.phd to reflect the 3
unique names that would be great
1. core
2. javacore*
3. heapdump*
Thanks

Doug Freyburger

2005-03-09, 5:57 pm

jdunphy wrote:
>
> i am currently doing this
> HEAP=`/usr/bin/find / -type f -name heap*.phd -newer $JOB_MARK -print
> 2>/dev/null`


Quote that star by bracketing the word in double-quotes
or using a backslash.

> i now have a new requirment to find 3 different files. i'd like to

keep
> it very very simple so if i could change heap*.phd to reflect the 3
> unique names that would be great
> 1. core
> 2. javacore*
> 3. heapdump*


\( -name core -o -name javacore\* -o -name heapdump\* \)

That clause in the place of your -name clause.

Find is the sysadmin's wonder program. Any sysadmin will
find it a week well spent to study the use of find until
they can dash off expressions, combine with xargs and so
on.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com