Skip to content
Advertisement

How do I escape spaces in file paths when iterating in a for loop with a shell script in Linux?

I am writing a shell script in Linux that takes a file path and iterates over all files in the path. When a file is found it performs some logic. If a folder is found the function calls itself passing the folder as an argument. It works well unless there is white space in the folder path.

JavaScript

Advertisement

Answer

Double quotes missing in

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement