Add setexpr command
PATCH v2 1/1 Add setexpr command
Add a simple expr style command that will set an env variable as the result of the command. This allows us to do simple math in shell. The following operations are supported: &, |, ^, +, -, *, /.
---
docs will be added online since that appears to be where all detailed command docs are located right now.
common/Makefile | 1 + common/cmd_setexpr.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++ include/config_cmd_all.h | 1 + 3 files changed, 72 insertions(+), 0 deletions(-) create mode 100644 common/cmd_setexpr.c
common/Makefile +1 -0
@@ -88,6 +88,7 @@ COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o COBJS-y += cmd_sata.o COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o +COBJS-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
common/cmd_setexpr.c new file +70 -0
70 lines not on this page · raw message
include/config_cmd_all.h +1 -0
@@ -70,6 +70,7 @@#define CONFIG_CMD_SAVES /* save S record dump */ #define CONFIG_CMD_SCSI /* SCSI Support */ #define CONFIG_CMD_SDRAM /* SDRAM DIMM SPD info printout */ +#define CONFIG_CMD_SETEXPR /* setexpr support */ #define CONFIG_CMD_SETGETDCR /* DCR support on 4xx */ #define CONFIG_CMD_SNTP /* SNTP support */ #define CONFIG_CMD_SPI /* SPI utility */
Signature · 1 line
1.5.3.8
PATCH v2 1/1 Add setexpr command
Quoted 7 lines · In message <[email protected]> you wrote:
Add a simple expr style command that will set an env variable as the result of the command. This allows us to do simple math in shell. The following operations are supported: &, |, ^, +, -, *, /.
Signed-off-by Kumar Gala <[email protected]>---
Quoted 8 lines
docs will be added online since that appears to be where all detailed command docs are located right now.
common/Makefile | 1 + common/cmd_setexpr.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++ include/config_cmd_all.h | 1 + 3 files changed, 72 insertions(+), 0 deletions(-) create mode 100644 common/cmd_setexpr.c
Well, actually I applied this one... Thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de It seems intuitively obvious to me, which means that it might be wrong. -- Chris Torek