From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D31F2C11F68 for ; Fri, 2 Jul 2021 11:30:24 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D98B361402 for ; Fri, 2 Jul 2021 11:30:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D98B361402 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9DB3D81D1F; Fri, 2 Jul 2021 13:30:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1625225422; bh=AuuG1yDQKa8svi56GkPerbV+DnVtcNY98+j3nKKDSIU=; h=To:cc:From:Subject:In-reply-to:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=eTxcsfrIEK9Z22fwRfb2eGBk/2qWQB+Wm0xUeu3OqfOm2eB3EJgPI1To2wu+36+kf GL8JhC7kqy/xVy/cfyTGl+mxzc0hmuIwPEZPfJBLGwQvaYj1QI3HHf9+Jrg8cmwhoE Dav/BG7X/WBg/qH4gqjPoOjv1gTR8tx43CUOiqSz9Jlnt2LQ+Kjf9iq582o6+ZXuZM Oninv0OmuEOEI5otPJtYzJBoYP0kIcsel6b/mvrEXKPBY3+30VXYT3TbT53KivxjoQ VBPHy1gATbrDwleXK3evUv/lpxMyQFaY6u/4YUMlHiAlwEXW3lFEQT26HMA4+mkbet Swbki6vAzStQw== Received: from janitor.denx.de (unknown [62.91.23.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: noc@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 8071A81668 for ; Fri, 2 Jul 2021 13:30:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1625225420; bh=AuuG1yDQKa8svi56GkPerbV+DnVtcNY98+j3nKKDSIU=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=g0BxzKWmuxulx5G61rSxhFVG2In9Et1ulBcNN1EnSgbvAnXXzSJSUuJUHZDIhK1a0 IhIdeGXEU2fkji21hOrnOmXNSEizR8MnEe5uae9Ua2bzF7F2V939YbEy00M7ekrLW0 FbjlnSRUvlODjpl44wKs9YsHs55+9hCnSj6NvkiES6MHc61sZm8CwZB3QgrJBedT1Q 0nwq3KbcJmL3LRATtITa3RxQWEgEvGpPHgQg5AeAoD4VKrdQwpcJ00z8MssB8PNAIG hMJWFqOAvzzOycVGTi1eUGkNgK60Nc3WWVI8DnBCfOUp99Eu0gIrOjO2cZP7BgOvkQ Nx5JK62BZCP0g== Received: by janitor.denx.de (Postfix, from userid 108) id E1BF1A0237; Fri, 2 Jul 2021 13:30:19 +0200 (CEST) Received: from gemini.denx.de (gemini.denx.de [10.4.0.2]) by janitor.denx.de (Postfix) with ESMTPS id A1B2FA0091; Fri, 2 Jul 2021 13:30:12 +0200 (CEST) Received: from gemini.denx.de (localhost [IPv6:::1]) by gemini.denx.de (Postfix) with ESMTP id 507831E2038; Fri, 2 Jul 2021 13:30:12 +0200 (CEST) To: Tom Rini cc: Sean Anderson , u-boot@lists.denx.de, Marek =?iso-8859-1?Q?Beh=FAn?= , Simon Glass , Roland Gaudig , Heinrich Schuchardt , Kostas Michalopoulos From: Wolfgang Denk Subject: Re: [RFC PATCH 00/28] cli: Add a new shell MIME-Version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8bit In-reply-to: <20210701202155.GQ9516@bill-the-cat> References: <20210701061611.957918-1-seanga2@gmail.com> <20210701202155.GQ9516@bill-the-cat> Comments: In-reply-to Tom Rini message dated "Thu, 01 Jul 2021 16:21:55 -0400." Date: Fri, 02 Jul 2021 13:30:12 +0200 Message-ID: <128634.1625225412@gemini.denx.de> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Dear Tom, In message <20210701202155.GQ9516@bill-the-cat> you wrote: > > First, great! Thanks for doing this. A new shell really is the only > viable path forward here, and I appreciate you taking the time to > evaluate several and implement one. I disagree that a new shell is the _only_ way forward. AFAICT, all the raised concerns have long been fixed in upstream versions of hush; see for example [1]: ... //config: hush is a small shell. It handles the normal flow control //config: constructs such as if/then/elif/else/fi, for/in/do/done, while loops, //config: case/esac. Redirections, here documents, $((arithmetic)) //config: and functions are supported. //config: [1] https://git.busybox.net/busybox/tree/shell/hush.c#n98 My gut feeling is that updating to a recent version of hush is the most efficent _backward_compatible_ way. And if we drop that requirement, we might even take a bigger step and move to lua - which would allow for a complete new level of script based extensions. > > - There is a serious error handling problem. Most original LIL code never > > checked errors. In almost every case, errors were silently ignored, even > > malloc failures! While I have designed new code to handle errors properly, > > there still remains a significant amount of original code which just ignores > > errors. In particular, I would like to ensure that the following categories of > > error conditions are handled: This is something that scares me like hell. This in a shell? For me this is close to a killing point. > > - Running out of memory. > > - Access to a nonexistant variable. > > - Passing the wrong number of arguments to a function. > > - Interpreting a value as the wrong type (e.g. "foo" should not have a numeric > > representation, instead of just being treated as 1). Who says so? Bash says: -> printf "%d\n" foo -bash: printf: foo: invalid number 0 So it is _not_ 1 ... > > - There are many deviations from TCL with no purpose. For example, the list > > indexing function is named "index" and not "lindex". It is perfectly fine to > > drop features or change semantics to reduce code size, make parsing easier, > > or make execution easier. But changing things for the sake of it should be > > avoided. It's not a standard POSIX shell, it's not TCL (ick!), ... it's something new, incompatible... > Thanks for the evaluations, of these, lil does make the most sense. You mean, adding a complete new, incompatible and non-standard shell is a better approach than updating to a recent version of hush? What makes you think so? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de Ernest asks Frank how long he has been working for the company. "Ever since they threatened to fire me."