-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Heiko Baumann on 5/9/2007 1:40 AM:
> Hi,
> 
> it would be nice to have a --include-from=file option for du(1).
> 
> i have a plain text file with a lot of path names (verbose output from tar) 
> in it and want to get the size for this files.
> 
> myhost:~ # du -sch `cat file.txt`
> -bash: /usr/bin/du: Argument list too long
> myhost:~ #
> 
> does not work.
> 
> i tried xargs(1) but this breaks -s functionality :(

Thanks for the report.  However, du already has --files0-from=file, which
solves your problem in a more secure manner (it handles arbitrary file
names correctly, where your request would not).  Assuming that file.txt
did not include any files with a newline in the name, you can do:

# tr '\n' '\0' < file.txt > file0.txt
# du -sch --files0-from=file0.txt

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGQblh84KuGfSFAYARAnDJAJ97/5Uwqn4roaPVayW2KsgJZHdt3QCghlw/
ciNnMNoIhi6tv8uspQjq3LQ=
=HuHx
-----END PGP SIGNATURE-----


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to