2015-12-10 10:40:30 -0700, Bob Proulx:
[...]
> In this instance the first thing I thought of when I read your dirname
> -f request was a loop.
>
>while read dir; do dirname $dir; done < list
"read dir" expects the input in a very specific format and
depends on the current value of IFS (like
On 11/12/15 14:46, Stephane Chazelas wrote:
> 2015-12-10 10:40:30 -0700, Bob Proulx:
> [...]
>> In this instance the first thing I thought of when I read your dirname
>> -f request was a loop.
>>
>>while read dir; do dirname $dir; done < list
>
> "read dir" expects the input in a very
Nellis, Kenneth wrote:
> Still, my -f suggestion would be easier to type,
> but I welcome your alternatives.
Here is the problem. You would like dirname to read a list from a
file. Someone else will want it to read a file list of files listing
files. Another will want to skip one header line.
I got it. You don't like the idea. That's fine. Please close the ticket.
--Ken
> -Original Message-
> From: Bob Proulx [mailto:b...@proulx.com]
> Sent: Thursday, December 10, 2015 12:41 PM
> To: Nellis, Kenneth
> Cc: 22...@debbugs.gnu.org
> Subject: Re: bug#22128: d
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
tag 22128 notabug
close 22128
stop
On 09/12/15 17:31, Nellis, Kenneth wrote:
> I frequently need to extract the `dirname's from a list of files,
> so dirname should have an option to take its input from a
> file, e.g.:
>
> dirname -f
xargs dirname < filename
> where could be "-" for stdin.
>