linux?type命令用法实战教程(linuxvi编辑器的用法)学到了

随心笔谈9个月前发布 admin
230 00
🌐 经济型:买域名、轻量云服务器、用途:游戏 网站等 《腾讯云》特点:特价机便宜 适合初学者用 点我优惠购买
🚀 拓展型:买域名、轻量云服务器、用途:游戏 网站等 《阿里云》特点:中档服务器便宜 域名备案事多 点我优惠购买
🛡️ 稳定型:买域名、轻量云服务器、用途:游戏 网站等 《西部数码》 特点:比上两家略贵但是稳定性超好事也少 点我优惠购买

文章摘要

这篇文章介绍了两个shell命令:`type`和`typeset`。`type`命令用于显示变量引用的信息,包括变量名、值或数组信息,也可以解释shell内置函数的类型。`typeset`命令用于声明全局变量,但已被`declare`命令取代,建议使用`declare`。文章详细描述了`type`命令的多种使用选项,如`-t`可显示命令的类型(如`alias`、`keyword`等),`-p`可显示对应的文件路径,`-a`可显示所有使用到的执行文件。文章还提到`typeset`命令的一些选项及其功能,但最终指出其为过时命令,建议使用`declare`命令。

[root@new55 ~]#?type -a type?
type is a shell builtin
[root@new55 ~]#?help type?
type: type [-afptP] name [name …]
? For each NAME, indicate how it would be interpreted if used as a
? command name.
? If the -t option is used, `type’ outputs a single word which is one of
? `alias’, `keyword’, `function’, `builtin’, `file’ or `’, if NAME is an
? alias, shell reserved word, shell function, shell builtin, disk file,
? or unfound, respectively.
? If the -p flag is used, `type’ either returns the name of the disk
? file that would be executed, or nothing if `type -t NAME’ would not
? return `file’.
? If the -a flag is used, `type’ displays all of the places that contain
? an executable named `file’.? This includes aliases, builtins, and
? functions, if and only if the -p flag is not also used.
? The -f flag suppresses shell function lookup.
? The -P flag forces a PATH search for each NAME, even if it is an alias,
? builtin, or function, and returns the name of the disk file that would
? be executed.
typeset: typeset [-afFirtx] [-p] name[=value] …
? Obsolete.? See `declare’.
[root@new55 ~]#

© 版权声明

相关文章