-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [Please keep the list in the loop, and please don't top-post]
According to Aaron Peterson on 12/7/2008 3:35 AM: > Yes, scripts can be made. I'm pretty much sure that the guy on the > debian list was planning to manually prune the files listed. I just > realized that his desire to edit the list is ultimately screwed even > futher by the possibility of newline being in the filename, and se > > I just realized Padriags solution is limited to just the line count > because it nukes all \ns!!!!! > > If I need to convert between \0 and \n for programs I have to go thru > all of this rigamorol: > > Solution for the edit ability option would then be to translate all > \n to \\n AND \0s to \\n\n then do the line by line operation, then > convert all \\n\ns back to \0 > but I have a hunch that that won't work because what if \\\\n\n\n > is my literal filename?! > so I am also going to have to do \\n to \\\\n. No, if you want to be able to handle \n in filenames, then you merely need generate the list with NUL separators to begin with. > > So, > > find -iname "*" -type f -0 | tr \\n \\\\n | tr \n \\n | tr \0 \\n\n | > editor that takes from stdin and writes to stdout | linecount program > | tr \\n\n \0 | tr \\n \n | tr \\\\n \\n | du --files0-from - find does not have a -0 option. GNU findutils, however, provides a - -print0 option. And if you are using it, then the output is ALREADY NUL-terminated and newlines are no longer a problem; you don't need to add tr in the mix, and you don't need to worry about newlines or about literal backslashes followed by n. Anyway, 'tr \\n \\\\n' does not do what you think - there is no way to make tr cause character sequences in the original expand to even more characters in the replacement; you need sed for that. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkk72uoACgkQ84KuGfSFAYB21gCgm5DpIghscI9LTS+V1HxfsXtJ 5gsAn1cjjFF8hL7f8Jd8NLY6MoL+u7G8 =dWWB -----END PGP SIGNATURE----- _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils