Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有些服务器只支持ftp上传文件。
当我将一个项目从我的 subversion 存储库导出到我的 windows 机器时,所有 (linux) 符号链接都被占位符文件替换:
链接 ../www_public/images
上传我现在使用的所有导出文件后
查找 | xargs grep -P ^link
找到所有这些占位符。然后我手动将它们替换为实际的符号链接。
我真的很想用一个shell脚本来自动化这一步。 我该怎么做?
注意: 如果这个问题有更好/不同的解决方案,请不要犹豫分享:)
这是一种可能的解决方案:
: grep -lr '^link' . | while read placeholderfile do linkfile=`cut -c6- "$placeholderfile"` ln -sf "$linkfile" "$placeholderfile" done
编辑:在下面的评论中更改了上面的代码。