分页: 1 / 1

钻牛角尖的一个问题: 怎么查看 echo --help

发表于 : 2011-10-25 18:59
tdounnyy
同理 echo --version

:em09

Re: 钻牛角尖的一个问题: 怎么查看 echo --help

发表于 : 2011-10-25 19:37
wjchen
以下摘自man echo:
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.
以下摘自man bash:

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:
...

也就是说bash内建的命令echo不支持--help --version参数的。

所以要想看到--help,--version,可以:

代码: 全选

/bin/echo --help
/bin/echo --version

Re: 钻牛角尖的一个问题: 怎么查看 echo --help

发表于 : 2011-10-25 20:04
acer4740
lz是lzu?

Re: 钻牛角尖的一个问题: 怎么查看 echo --help

发表于 : 2011-10-25 20:51
tdounnyy
受教了! man echo 那句我也看到了,但是没看懂 :em20

Re: 钻牛角尖的一个问题: 怎么查看 echo --help

发表于 : 2011-10-28 22:41
退避九舍

代码: 全选

help echo