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.
我只找到了如何在文件中查找字符串,但是如何替换注释行以及我应该如何替换它们?
#!/bin/sh echo enter file name read fname exec<$fname while read line do echo $line; done
为了移动名称与模式匹配的文件.gitignore,请尝试以下循环:
.gitignore
while read pattern; do echo mv $pattern /var/tempdir done < .gitignore
如果此循环的输出看起来像正确的命令列表,请删除单词“echo”并再次运行循环以实际移动文件。