为什么会有一个‘.’在chown工作?

为什么会有一个‘.’在chown工作?

GNU 为何能chown user.group发挥作用?文档没有提及支持的语法。这背后是否还有一段动人的故事呢?

答案1

info chown很清楚:

Some older scripts may still use `.' in place of the `:' separator.
POSIX 1003.1-2001 (*note Standards conformance::) does not require
support for that, but for backward compatibility GNU `chown' supports
`.' so long as no ambiguity results. New scripts should avoid the use
of `.' because it is not portable, and because it has undesirable
results if the entire OWNER`.'GROUP happens to identify a user whose
name contains `.'.

对于GNU程序来说,通常不仅值得检查,man而且还值得检查info页面,因为GNU 人讨厌手册页(从man tar)。

相关内容