Essentially I want the inverse operation performed in this question.
I'm running a search, looking for files that have Windows line endings (\r\n
) as I want to remove them.
$ grep -URl ^M .
Some of the returned files have spaces in their names:
./file name 1.txt
./file name 2.txt
In order to pass this on to another tool via xargs
, I need to quote the lines. How can I transform to this output instead:
"./file name 1.txt"
"./file name 2.txt"