Skip to content

The -p option does not have the alias function #15382

@witt-bit

Description

@witt-bit

tldr -p linux awk output :

$ tldr -p linux awk                                                                                                  ✔ 
`awk` documentation is not available.
If you want to contribute it, feel free to send a pull request to: https://github.com/tldr-pages/tldr

tldr awk output :

$ tldr awk                                                                                                         1 ✘ 

  awk

  一种用于文件处理的通用编程语言。
  更多信息:https://github.com/onetrueawk/awk.

  - 以空格为分隔符,打印文件每行第五列(也称作字段):
    awk '{print $5}' 文件名

  - 以空格为分隔符,打印文件包含“foo” 的所有行的第二列:
    awk '/foo/ {print $2}' 文件名

  - 以逗号而不是空格作为分隔符,打印文件每行的最后一列:
    awk -F ',' '{print $NF}' 文件名

  - 计算文件的第一列数值之和并打印:
    awk '{s+=$1} END {print s}' 文件名

  - 从第一行开始,每三行打印一行:
    awk 'NR%3==1' 文件名

  - 根据条件不同,打印不同内容:
    awk '{if ($1 == "foo") print "Exact match foo"; else if ($1 ~ "bar") print "Partial match bar"; else print "Baz"}' 文件名

  - 打印第 10 列等于指定值的所有行:
    awk '($10 == 指定值)'

  - 打印第 10 列介于最小值和最大值之间的所有行:
    awk '($10 >= 最小值 && $10 <= 最大值)'

The awk command is located in common/awk.md and should work on any platform (linux, macos, etc.), at least no matter what the -p option is, you should get the documented results.


The reason why I have this problem is that I execute the command tldr gawk and the output is

$ tldr gawk                                                                                                          ✔ 

  gawk

  这是 `-p linux awk` 命令的一个别名。

  - 原命令的文档在:
    tldr -p linux awk

Found 2 pages with the same name under the platforms: osx, osx.

Leads me to execute tldr -p linux awk,After I executed it, the following prompts

$ tldr -p linux awk                                                                                                  ✔ 
`awk` documentation is not available.
If you want to contribute it, feel free to send a pull request to: https://github.com/tldr-pages/tldr

I think this is ill-designed!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions