我无法设置其他人的 setuid 位。为什么?有安全锁吗?
$ ls -l
-rwxrwxr-x 1 allexj allexj 16784 Mar 11 17:30 a.out
$ chmod o=+s a.out
$ ls -l
-rwxrwx--- 1 allexj allexj 16784 Mar 11 17:30 a.out
Run Code Online (Sandbox Code Playgroud) 我有这个 sed 过滤器:
/.*[1-9][0-9][0-9] .*/{
s/.*\([1-9][0-9][0-9] .*\)/\1/
}
/.*[1-9][0-9] .*/{
s/.*\([1-9][0-9] .*\)/\1/
}
/.*[0-9] .*/{ # but this is always preferred/executed
s/.*\([0-9] .*\)/\1/
}
Run Code Online (Sandbox Code Playgroud)
问题是前两个限制性更强,并且它们没有被执行,因为最后第三个更“强大”,因为它包括前两个。有没有办法让 sed 采取前两个,并带有“优先顺序”?喜欢
if the first matches
do first things
elif the second matches
do second things
elif the third matches
do third things
Run Code Online (Sandbox Code Playgroud)