core: filenames might have a space, escape it befor os:cmd/1

(cherry picked from commit f7feffe5d02be275fd2e63051948696360ccc6ab)