小编Set*_* II的帖子

stat --format %N 引号

我在两个不同版本的 Ubuntu 上使用了 stat,它打印了不同类型的引号。

14.04 (coreutils 8.21-1ubuntu5.1):

$ stat --format %N test.txt
‘test.txt’
Run Code Online (Sandbox Code Playgroud)

16.04 (coreutils 8.25-2ubuntu2):

$ stat --format %N test.txt
'test.txt'
Run Code Online (Sandbox Code Playgroud)

为什么stat在旧版本中使用这种不常见的引用样式,有没有办法告诉stat它应该使用哪种类型的引用?

编辑

我知道在 8.26 版中为 stat 引入了引用样式(https://savannah.gnu.org/forum/forum.php?forum_id=8745):

  stat --format=%N for quoting file names now honors the
  same QUOTING_STYLE environment variable values as ls.
Run Code Online (Sandbox Code Playgroud)

但是在此更改之前,版本之间应该有一致的行为,还是有其他我不知道的更改?

ubuntu stat quoting

3
推荐指数
1
解决办法
883
查看次数

标签 统计

quoting ×1

stat ×1

ubuntu ×1