bash - Bash 5.0 的 --pretty-print 选项有什么用?

标签 bash

使用 Bash 5.0:

$ bash --help
GNU bash, version 5.0.0(1)-release-(x86_64-pc-linux-gnu)
Usage:  bash [GNU long option] [option] ...
    bash [GNU long option] [option] script-file ...
GNU long options:
    --debug
    --debugger
    --dump-po-strings
    --dump-strings
    --help
    --init-file
    --login
    --noediting
    --noprofile
    --norc
    --posix
    --pretty-print
    --rcfile
    --restricted
    --verbose
    --version

这个 --pretty-print 选项是什么?我在 Bash 5.0 手册页和互联网上都找不到它!好神秘:O

最佳答案

找到了 8)

在代码源中,CWRU/changelog 第 1427 行:

shell.c
    - --pretty-print: new invocation option, currently undocumented, dumps
      a pretty-printed version of a shell script given as an argument to
      stdout

我刚刚试过了,它的工作方式类似于 type 的功能,但适用于整个脚本!整洁的。不过,评论将被删除!

关于bash - Bash 5.0 的 --pretty-print 选项有什么用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55582730/

相关文章:

ruby - rvm 不是函数,因为 gnome 终端将 bash 作为非登录 shell 运行?

bash - Cygwin程序已编译但无法运行

linux - 通过命令/应用程序在 bash 提示符下打印的包装行前缀

linux - 用于在文本文件中查找模式并返回整行的 bash 脚本

linux - 如何打印模式中的第 n 行?

linux - linux shell 管道是流水线吗?

bash - Elasticsearch bash 脚本不起作用,但如果我复制并粘贴到终端中,它就可以工作

arrays - Bash 映射两个数组

linux - 管道 ls 到 less 并实时监控文件系统更改

bash - 如何从终端将文件名中的字符附加到文件每一行的末尾?