在Ubuntu命令中,使用”ls -l”与”jc”的kellyjonbrazil部分不正确。

huangapple go评论57阅读模式
英文:

In Ubuntu command ls -l with jc of kellyjonbrazil dosn´t work correct

问题

I try to convert the ls -l command with jc (from js) in a json-object.

ls -l | jc --ls -p

Unfortunate I get this output:

在Ubuntu命令中,使用”ls -l”与”jc”的kellyjonbrazil部分不正确。

But according to docs from Developer (docs the output must be something líke that.

$ ls -l /usr/bin | jc --ls -p -r
[
  {
    "filename": "apropos",
    "link_to": "whatis",
    "flags": "lrwxrwxrwx.",
    "links": "1",
    "owner": "root",
    "group": "root",
    "size": "6",
    "date": "Aug 15 10:53"
  },
  {
    "filename": "arch",
    "flags": "-rwxr-xr-x.",
    "links": "1",
    "owner": "root",
    "group": "root",
    "size": "33080",
    "date": "Aug 19 23:25"
  },
  ...
]

I exoected this output with this command:

$ ls -l /usr/bin | jc --ls -p -r

[
  {
    "filename": "apropos",
    "link_to": "whatis",
    "flags": "lrwxrwxrwx.",
    "links": "1",
    "owner": "root",
    "group": "root",
    "size": "6",
    "date": "Aug 15 10:53"
  },
  {
    "filename": "arch",
    "flags": "-rwxr-xr-x.",
    "links": "1",
    "owner": "root",
    "group": "root",
    "size": "33080",
    "date": "Aug 19 23:25"
  },
  ...
]

Have anybody a idea or experience?

I thank you in advance

Andrej

英文:

I try to convert the ls -l command with jc (from js) in a json-object.

ls -l | jc --ls -p

Unfortunate I get this output:

在Ubuntu命令中,使用”ls -l”与”jc”的kellyjonbrazil部分不正确。

But according to docs from Developer (docs the output must be something líke that.


$ ls -l /usr/bin | jc --ls -p -r
[
  {
    "filename": "apropos",
    "link_to": "whatis",
    "flags": "lrwxrwxrwx.",
    "links": "1",
    "owner": "root",
    "group": "root",
    "size": "6",
    "date": "Aug 15 10:53"
  },
  {
    "filename": "arch",
    "flags": "-rwxr-xr-x.",
    "links": "1",
    "owner": "root",
    "group": "root",
    "size": "33080",
    "date": "Aug 19 23:25"
  },
  ...
]

I exoected this output with this command:


$ ls -l /usr/bin | jc --ls -p -r
[
  {
    "filename": "apropos",
    "link_to": "whatis",
    "flags": "lrwxrwxrwx.",
    "links": "1",
    "owner": "root",
    "group": "root",
    "size": "6",
    "date": "Aug 15 10:53"
  },
  {
    "filename": "arch",
    "flags": "-rwxr-xr-x.",
    "links": "1",
    "owner": "root",
    "group": "root",
    "size": "33080",
    "date": "Aug 19 23:25"
  },
  ...
]

Have anybody a idea or experience?

I thank you in advance

Andrej

答案1

得分: 1

只返回翻译好的部分:

可能该工具仅处理ls的非本地化输出。尝试使用C区域设置运行它:

LC_ALL=C ls - l | jc --ls -p
英文:

It's possible the tool only handles non-localised output of ls. Try running it with the C locale:

LC_ALL=C ls - l | jc --ls -p

huangapple
  • 本文由 发表于 2023年3月31日 17:19:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/75896786.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定