I have a find result saved in a variable and I am protecting the spaces in filenames by adding a single quotes around the output. So the for loop works flawlessly.
My problem is when I intend to grep one of those files, it says "File does not exist" because is literally taking the single quotes as part of the filename.
How can I overcome this??
all_files=$(find . -type f -printf "'%p'") for file in $all_files do grep 'hello' $file ### this says "file.not found because of the single quotes done