GNU bug report logs - #22128
dirname: accept file list input

Previous Next

Package: coreutils;

Reported by: "Nellis, Kenneth" <Kenneth.Nellis <at> xerox.com>

Date: Thu, 10 Dec 2015 01:09:02 UTC

Severity: wishlist

Tags: wontfix

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 22128 <at> debbugs.gnu.org (full text, mbox):

From: "Nellis, Kenneth" <Kenneth.Nellis <at> xerox.com>
To: Bob Proulx <bob <at> proulx.com>, "22128 <at> debbugs.gnu.org"
 <22128 <at> debbugs.gnu.org>
Subject: RE: bug#22128: dirname enhancement
Date: Thu, 10 Dec 2015 16:49:24 +0000
Thanx. Hadn't yet discovered GNU find's -printf option.
Still, my -f suggestion would be easier to type,
but I welcome your alternatives.
-Ken

> -----Original Message-----
> From: Bob Proulx [mailto:bob <at> proulx.com]
> Sent: Thursday, December 10, 2015 11:34 AM
> To: Nellis, Kenneth; 22128 <at> debbugs.gnu.org
> Subject: Re: bug#22128: dirname enhancement
> 
> Pádraig Brady wrote:
> > Nellis, Kenneth wrote:
> > > E.g., to get a list of directories that contain a specific file:
> > >
> > > find -name "xyz.dat" | dirname -f -
> >
> > find -name "xyz.dat" -print0 | xargs -r0 dirname
> 
> Also if using GNU find can use GNU find's -printf operand and %h to
> print the directory of the matching item.  Not portable to non-gnu
> systems.
> 
>   find . -name xyz.dat -printf "%h\n"
> 
> Can generate null terminated string output for further xargs -0 use.
> 
>   find . -name xyz.dat -printf "%h\0" | xargs -0 ...otherstuff...
> 
> Bob





This bug report was last modified 6 years and 215 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.