RK356x U-Boot研究所(命令篇)3.8 test命令的用法

本文介绍了RK356x U-Boot中的test命令,包括其启用 Busybox hush shell的功能,使得shell脚本操作更为强大。test命令用于基本的脚本操作,通过宏定义实现不同功能,如字符串比较等。在U-Boot Shell中,可以通过test命令进行条件判断,例如检查字符串是否相等或为空。
平台 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脚本”)。
如果禁用,将得到旧的、更简单的行为,内存占用较小

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

嵌入式逍遥

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值