[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#22128: dirname enhancement
From: |
Bob Proulx |
Subject: |
bug#22128: dirname enhancement |
Date: |
Thu, 10 Dec 2015 09:34:10 -0700 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
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
- bug#22128: dirname enhancement, Nellis, Kenneth, 2015/12/09
- bug#22128: dirname enhancement, Pádraig Brady, 2015/12/09
- bug#22128: dirname enhancement,
Bob Proulx <=
- bug#22128: dirname enhancement, Nellis, Kenneth, 2015/12/10
- bug#22128: dirname enhancement, Bob Proulx, 2015/12/10
- bug#22128: dirname enhancement, Nellis, Kenneth, 2015/12/10
- bug#22128: dirname enhancement, Stephane Chazelas, 2015/12/11
- bug#22128: dirname enhancement, Pádraig Brady, 2015/12/11
- bug#22128: dirname enhancement, Stephane Chazelas, 2015/12/11