tag:blogger.com,1999:blog-37642571.post6853223593438751651..comments2024-03-20T02:30:44.457-07:00Comments on Thinking In Software: Solaris find and xargs with files and directories containing spacesNestor Urquizahttp://www.blogger.com/profile/12351754666722274569noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-37642571.post-58740326706415782862013-09-08T18:11:28.027-07:002013-09-08T18:11:28.027-07:00I see now. The old newline in filename discussion....I see now. The old newline in filename discussion. This is huge (read http://www.dwheeler.com/essays/fixing-unix-linux-filenames.html) but to simplify I suggest you consider filenames with newlines invalid. Any code generating them should be fix. If that is not possible (like when you do not own the code generating them, you will need to rename them as I just posted in http://thinkinginsoftware.blogspot.com/2013/09/reconsider-those-newline-in-filename.htmlNestor Urquizahttps://www.blogger.com/profile/12351754666722274569noreply@blogger.comtag:blogger.com,1999:blog-37642571.post-49048016225284420432013-09-07T00:52:49.033-07:002013-09-07T00:52:49.033-07:00Sure. I'm currently checking large filesystems...Sure. I'm currently checking large filesystems and some users have created files with newlines in the filename. Here's an example<br /><br />touch "test <br />"<br />touch test2<br />find . -type f<br /><br />Now you will notice, that find outputs the filename including the newline. Thus piping the filename to another tool like sed does not work. Do you have an idea how to handle this?Anonymoushttps://www.blogger.com/profile/17788182644479762389noreply@blogger.comtag:blogger.com,1999:blog-37642571.post-79486623902441622252013-09-06T18:05:19.819-07:002013-09-06T18:05:19.819-07:00@Florian perhas with a test case I can help you be...@Florian perhas with a test case I can help you better. Please share simple commands illustrating your issue and I will try to help. Best,Nestor Urquizahttps://www.blogger.com/profile/12351754666722274569noreply@blogger.comtag:blogger.com,1999:blog-37642571.post-87224609574931446602013-09-05T07:16:03.601-07:002013-09-05T07:16:03.601-07:00Thanks for this helpful hint! The only problem I&#...Thanks for this helpful hint! The only problem I'm left with now are newlines in filenames. Do you know any way to make find output newlines with a \n instead of the newline?Anonymoushttps://www.blogger.com/profile/17788182644479762389noreply@blogger.com