bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22128: dirname enhancement


From: Pádraig Brady
Subject: bug#22128: dirname enhancement
Date: Thu, 10 Dec 2015 01:45:43 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

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 <filename>

xargs dirname < filename

> where <filename> could be "-" for stdin.
> 
> 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

> The same would be good for `basename' as well.

xargs basename -a < filename

thanks,
Pádraig.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]