escape ticks and spaces in paths