[9fans] How do you deal with newlines (line feed, LF, \n) in filenames?

2024-08-10 Thread kalterdev
Suppose you want to grep over a filtered list of files. Is there an idiomatic approach to solve this problem with rc? I can only think of one erroneous method: grep pattern `{find . -type f -name '*_test.go'} I know that it's possible to use find(1)'s -exec option. But find does not exist in P

Re: [9fans] How do you deal with newlines (line feed, LF, \n) in filenames?

2024-08-10 Thread sirjofri
Hi, having newlines in filenames is questionable. However, needing a newline is quite common. In rc, you don't encode the newline, you just use it: echo here is my ' ' newline. It's quite common to define it as a variable for easier use, for example: nl=' ' echo $nl files=`$nl{ls} echo $files(

[9fans] Re: How do you deal with newlines (line feed, LF, \n) in filenames?

2024-08-10 Thread kalterdev
Hi sirjofri, Thank you for your reply. I was referring to having newlines specifically in filenames. Sometimes it's not one's own fault that filenames have them. I wasn't really speaking about the way to represent a newline in rc, although thanks for details on that problem. My problem is to pa

Re: [9fans] Re: How do you deal with newlines (line feed, LF, \n) in filenames?

2024-08-10 Thread sirjofri
10.08.2024 23:32:48 kalter...@gmail.com: > Thank you for your reply. I was referring to having newlines specifically in > filenames. Sometimes it's not one's own fault that filenames have them. Sure, that can happen. I just wonder who would do that on any system. > I wasn't really speaking about