[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How to escape "find" result



Hi,

I'm trying to run the following script:
  for f in $(find . -name "*.txt"); do cmd1;cmd2;cmd3; done
,where cmd1, cmd2 and cmd3 are arbiturary commands. The problem is, if the found file names contain a space , for example "part1 part2.txt" will be interpreted as "part1" and "part2.txt". I'm thinkin an esacping tool may be able turn it into "part1\ part2.txt" before passing it to "for" loop. Any thought?

Thanks,
-tk



Reply to: