
钻牛角尖的一个问题: 怎么查看 echo --help
-
- 帖子: 3
- 注册时间: 2010-05-21 21:52
钻牛角尖的一个问题: 怎么查看 echo --help
同理 echo --version


- wjchen
- 帖子: 583
- 注册时间: 2011-05-02 19:08
- 系统: ubuntu 12.04
Re: 钻牛角尖的一个问题: 怎么查看 echo --help
以下摘自man echo:
所以要想看到--help,--version,可以:
以下摘自man bash:NOTE: your shell may have its own version of echo, which usually supersedes the version described here. Please refer to your shell's documentation for details about the options it supports.
也就是说bash内建的命令echo不支持--help --version参数的。
echo [-neE] [arg ...]
Output the args, separated by spaces, followed by a newline.
The return status is always 0. If -n is specified, the trailing
newline is suppressed. If the -e option is given, interpreta‐
tion of the following backslash-escaped characters is enabled.
The -E option disables the interpretation of these escape char‐
acters, even on systems where they are interpreted by default.
The xpg_echo shell option may be used to dynamically determine
whether or not echo expands these escape characters by default.
echo does not interpret -- to mean the end of options. echo
interprets the following escape sequences:
...
所以要想看到--help,--version,可以:
代码: 全选
/bin/echo --help
/bin/echo --version
- acer4740
- 帖子: 1405
- 注册时间: 2010-09-13 19:04
- 来自: 0xFF00EE
-
- 帖子: 3
- 注册时间: 2010-05-21 21:52
Re: 钻牛角尖的一个问题: 怎么查看 echo --help
受教了! man echo 那句我也看到了,但是没看懂 

- 退避九舍
- 帖子: 742
- 注册时间: 2010-08-08 20:02
- 系统: Ubuntu 22.04