Re: problems with FIND cmd
From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 04/30/04
- Next message: John W. Krahn: "Re: Sort the file"
- Previous message: Barry Margolin: "Re: FTP Client which will FTP only one file type say HTML"
- In reply to: Charles Demas: "Re: problems with FIND cmd"
- Next in thread: rakesh sharma: "Re: problems with FIND cmd"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 29 Apr 2004 20:31:32 -0400
In article <c6rte0$qfs$1@pcls3.std.com>,
demas@TheWorld.com (Charles Demas) wrote:
> In article <a8970d9b.0404291129.52ba145e@posting.google.com>,
> DJE <david.ehresmann@ps.net> wrote:
> >How do I restrict the output of the find command to just the file
> >name?
>
> pipe find's output through basename?
I don't think you understood the question. The problem isn't the
directory portion of the filename, the problem is that the output
contains two names, "." and "./test".
I suspect the solution is to use -type f in the find options, to keep it
from showing directories.
>
>
> Chuck Demas
>
> >Here is the code:
> >
> >thefile=$(find . -newer trace_file_tmp -print)
> > if [ -n "$thefile" ] ; then
> > do something
> > fi
> >
> >Here is the directory it is operating in:
> >
> >-rwxr-xr-x 1 oracle dba 611 Apr 9 11:16
> >ora_19842_elmcig76.trc
> >-rw-r--r-- 1 oracle dba 0 Apr 29 14:18 test
> >-rw-r--r-- 1 oracle dba 0 Apr 28 14:12 trace_file_tmp
> >
> >
> >With this code I am getting $thefile shown in debug mode:
> >
> >thefile=.
> >./test
> >+ [ -n .
> >./test ]
> >
> >
> >With $thefile set to . or ./test it is not working like I need it.
> >How do I restrict find to only "test"?
> >Any suggestion will be appreciated.
> >
> >thanks,
> >
> >DJE
-- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***
- Next message: John W. Krahn: "Re: Sort the file"
- Previous message: Barry Margolin: "Re: FTP Client which will FTP only one file type say HTML"
- In reply to: Charles Demas: "Re: problems with FIND cmd"
- Next in thread: rakesh sharma: "Re: problems with FIND cmd"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|