| 平台 | U-Boot 版本 | Linux SDK 版本 |
|---|---|---|
| RK356x | 2017.09 | v1.2.3 |
一、test命令的介绍
test 命令定义在cmd/test.c,需要使能以下配置:
obj-$(CONFIG_HUSH_PARSER) += test.o
以下介绍摘自cmd/Kconfig:
config HUSH_PARSER
bool "Use hush shell"
depends on CMDLINE
help
This option enables the "hush" shell (from Busybox) as command line
interpreter, thus enabling powerful command line syntax like
if...then...else...fi conditionals or `&&' and '||'
constructs ("shell scripts").
If disabled, you get the old, much simpler behaviour with a somewhat
smaller memory footprint.
翻译来看就是:
该选项启用 “hush” shell(来自Busybox)作为命令行解释器,从而启用强大的命令行语法,如if…then…else…Fi条件或 '&&'和 ‘||’ 结构(“shell脚本”)。
如果禁用,将得到旧的、更简单的行为,内存占用较小
本文介绍了RK356x U-Boot中的test命令,包括其启用 Busybox hush shell的功能,使得shell脚本操作更为强大。test命令用于基本的脚本操作,通过宏定义实现不同功能,如字符串比较等。在U-Boot Shell中,可以通过test命令进行条件判断,例如检查字符串是否相等或为空。
订阅专栏 解锁全文
1006

被折叠的 条评论
为什么被折叠?



