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 B2B04C07E96 for ; Tue, 6 Jul 2021 07:44:33 +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 B341F613AA for ; Tue, 6 Jul 2021 07:44:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B341F613AA 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 7508F82C56; Tue, 6 Jul 2021 09:44:30 +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=1625557470; bh=m7gb5mSDQ7oRbcfYv8d5MSf9NnFEO0ae8UrUeMFvlVc=; h=To:cc:From:Subject:In-reply-to:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=wp2qzqVIfV45/SFWgTIZiT50D3Czn8W+77GHHcWCg6fsbXMPjX+WD6oM5ZmToJpQj fudGmNYnkap6uWx4i3T9yADj93d68m7SL/o7tUJQ8Yh1xYEC7snYcAi+Tf5YiOV59c ExNQtYNa1oh4pJKbnjtpoDxyQBBwbM26zi1OGIbZxXT7KUEfhdCnKzkp9ryfO1S8Qw rGWSH4Fe3kT/fVvwR/BS2HtbURtIqsZC9tdrVFainSOVtGM38/i/hpdcBBN97ycEnU 9UGk/WYJG1iV5WrgIlUdzhpoRihCXTq176GFOKvCW/CcGF6RYQQTB+QtuJk+R82hVG m9BZggXWejTQQ== 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 3050582BD6 for ; Tue, 6 Jul 2021 09:44:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1625557468; bh=m7gb5mSDQ7oRbcfYv8d5MSf9NnFEO0ae8UrUeMFvlVc=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=SCfrOtjUcssOmV9VMmYFrQTkeVL+YVh9v3+ppduSBdHPCr6uV+snXDiqwYp/+joSp HvwYhR5ua+UGD9Hi1rJKlap0hYwihMsre+KtuK6uu+8T/47LCb12q2Kr61U458B/zq lTcFnREJ5qS6aUAdUe4xN04obpOIEJvkIVFzRD0QjApGxj/wPufOrEwb4+YLB/Z8kk 9Do5RVzBdbg0sBluvrAGjrbWPt8Asx11EYFjbGZ5t462nDDobk10F1w5VRAk9yjEQ9 WtewhQXOLPb1VacCXCs50uld0Wk01AaGPTK0TSlQRNdl3mCybs+V2JWpPXN7iGJars 1D2m2sLkoC96g== Received: by janitor.denx.de (Postfix, from userid 108) id DF30EA0285; Tue, 6 Jul 2021 09:44:27 +0200 (CEST) Received: from gemini.denx.de (gemini.denx.de [10.4.0.2]) by janitor.denx.de (Postfix) with ESMTPS id C3502A003A; Tue, 6 Jul 2021 09:44:20 +0200 (CEST) Received: from gemini.denx.de (localhost [IPv6:::1]) by gemini.denx.de (Postfix) with ESMTP id 698B91E1498; Tue, 6 Jul 2021 09:44:20 +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 02/28] cli: Add LIL shell MIME-Version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8bit In-reply-to: <20210705191058.GB9516@bill-the-cat> References: <20210701061611.957918-1-seanga2@gmail.com> <20210701061611.957918-3-seanga2@gmail.com> <126700.1625223815@gemini.denx.de> <8bbdb7a1-5085-a3b7-614f-12ae9aee8e8b@gmail.com> <18831.1625340810@gemini.denx.de> <20210705191058.GB9516@bill-the-cat> Comments: In-reply-to Tom Rini message dated "Mon, 05 Jul 2021 15:10:58 -0400." Date: Tue, 06 Jul 2021 09:44:20 +0200 Message-ID: <192103.1625557460@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 <20210705191058.GB9516@bill-the-cat> you wrote: > > > > foo=bar set foo bar > > > echo $foo echo $foo > > > > > > if [ 1 -gt 2 ]; then if {1 > 2} { > > > echo a echo a > > > else } { > > > echo b echo b > > > fi } > > > > > > foo() { proc foo {first second} { > > > echo $1 $2 echo $first $second > > > } } > > > > > > for file in $(ls *.c); do foreach file [glob *.c] { > > > echo $file echo $file > > > done } > > > > > > fact() { > > > if [ $1 -eq 0 ]; then > > > echo 1 > > > else > > > echo $(($1 * $(fact $(($1 - 1))))) > > > fi > > > } > > > > > > proc fact {n} { > > > if {$n} { > > > expr {$n * [fact [expr {$n - 1}]]} > > > } { > > > return 1 > > > } > > > } > > > > > > Hopefully this gives you a bit of a feel for the basic differences. > > Which of these things, from each column, can you do in the context of > U-Boot? That's important too. Well, with a current version of hush we can do: -> foo=bar -> echo $foo bar -> if [ 1 -gt 2 ]; then > echo a > else > echo b > fi b -> foo() { > echo $1 $2 > } -> foo bar baz bar baz -> for file in $(ls *.c); do > echo $file > done ls: cannot access '*.c': No such file or directory -> fact() { > if [ $1 -eq 0 ]; then > echo 1 > else > echo $(($1 * $(fact $(($1 - 1))))) > fi > } -> fact 4 24 Oh, in the contect of U-Boot? Well, there are of course limitations, but not because of the shell, but because of the fact that we have no concept of files, for example. But another command interpreter will not fix this. > This is I think the hard question. A draw of the current shell is that > it it looks and acts like bash/sh/etc, for at least basic operations. > That's something that's comfortable to a large audience. That has > disadvantages when people want to start doing something complex. Sean > has shown that several times and he's not the only one. LIL being > tcl'ish is not. Tcl is a horror of a language for anything that is above trivial level. Do you really think that replacing standard shell syntax with Tcl is "something that's comfortable to a large audience"? I seriously doubt that. > Something that has "sh" syntax but also clear to the user errors when > trying to do something not supported would also be interesting to see. > It seems like a lot of the frustration from users with our shell is that > it's not clear where the line between "this is an sh-like shell" and > "no, not like that" is. Did you run some tests on the version of hush as comes with recent busybox releases? Which of our user's requirements does it fail to meet? 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 The first thing we do is kill all the lawyers. (Shakespeare. II Henry VI, Act IV, scene ii)