shell脚本中 cd 到带空格的文件夹的大坑
文章目录
记录一下今天的大坑,xcode工程里有一个文件叫target support files的目录.没错你没看错,就是带空格的目录.咋之前听网上说是这样写、那样写,无非就是这两种
1.给路径加""
dirPath="YourProject/target support files"
cd $dirPath2.再加转义\
dirPath="YourProject/target\ support\ files"
cd $dirPath以上两种方法在mac上都行不通,会报YourProject/target not found,下面才是正确的写法
cd YourProject/target\ support\ files你没看错,就是不要双引号

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论