这两天在写一个缓存模块,需要把生成的缓存目录和文件设置成777权限,好让ftp用户可以直接登录删除缓存,蛋疼的事也就这么发生了,明明用了mkdir($path, 0777);用ftp用户登录却删除不了,为什么呢? 查看了一下建立的目录的权限,发现mkdir建立的目录权限都是755的,我明明用的是777,立马google了一下,才知道原来是受Linux 系统的 umask限制了,Linux的umask默认值是0022,所以php 的 mkdir 函数只能建立出755权限的文件夹出来。…
November 11, 2015
sed 执行错误:sed: 1: “…”: Invalid command code f
运行
grep -l \'texttofind\' * | xargs sed -i 's/toreplace/replacewith/g'
Im getting this error when I run the above command in the terminal.
sed: 1: "forkliftDailyChecklistW ...": invalid command code f
解决:
I figured out what was wrong. I needed to add ''
after the -i
and before the 's/../../'
:
grep -l \'texttofind\' * | xargs sed -i '' 's/toreplace/replacewith/g'
转自:http://stackoverflow.com/questions/29081799/sed-1-invalid-command-code-f
更多参考:
本文:sed 执行错误:sed: 1: “…”: Invalid command code f