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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C8F8CC433F5 for ; Wed, 12 Jan 2022 20:05:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A5825834C4; Wed, 12 Jan 2022 21:04:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="i6NTsy82"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 74D54833BE; Wed, 12 Jan 2022 21:04:03 +0100 (CET) Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 37AFC8344C for ; Wed, 12 Jan 2022 21:03:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-ot1-x334.google.com with SMTP id a23-20020a9d4717000000b0056c15d6d0caso3785819otf.12 for ; Wed, 12 Jan 2022 12:03:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EE46MsFeH+3V6A/EzXUoPpMnXR9RkeLeYY6MJoCyt2U=; b=i6NTsy82Znf3uGQjP820UDUK7iackuzDrLPDVm2AFmxJlC/ESiawMQiHejm8tLXgJ9 pTA3I7QuyBP/85qP1GLhOIyLrQ9skscYsXcUczY/+czk4P5ehAL1b2NZ6YrifJCFclRL S0AlTg0+cOpmFUKMrw8cbcOkMCPRDBDvQntTI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EE46MsFeH+3V6A/EzXUoPpMnXR9RkeLeYY6MJoCyt2U=; b=OnalMw9thl/oSztdcPbXznSoxipuwSQ9FBwDCvB/8V7VJNeUUJ64/S8DlBQUfUfDjF Xc0kWLEpHsQ9Kd3ZngOkcCBwqEYevXKq2gWQZyhcpdVlnF7S+Uur6mdx5JfkBwu9jTK8 aZ8CB/ZVQhf8uIwKIDNGizPHkfduCJlP37sO500cf8HiabaJivvJyWNHFIofZqLQEy4Z NuOKjyOc0zqo3wK4cLnwLmjXz8PJ0tgtVDaZ0eO7DRSteg1C4gFVQ0rUpuoKMW2M1SNY bLKlWeFnkwe6gxySy1IvXV++cPGbFQM2woUJiKK/oeMdx1l8+GiXL1wPTHU1jR2nlgtO FdQw== X-Gm-Message-State: AOAM533kh0fZBobra33h7n68NKoDZVB/nqfbZderEzGpMEx8aJkqFqgF MH0K9RnhAKAihvnPN1RYrvhlzySJY8EqtXVBaiEmww== X-Google-Smtp-Source: ABdhPJz6qunC0q6iftJS+LNx/gA0n1fG8W571djQuMFDWbA7netgoEeuKY8+5n/abdllasFjEx19jqdhC4ikHZnSopI= X-Received: by 2002:a9d:6012:: with SMTP id h18mr1035971otj.203.1642017834732; Wed, 12 Jan 2022 12:03:54 -0800 (PST) MIME-Version: 1.0 References: <20211231161327.24918-1-francis.laniel@amarulasolutions.com> <20211231161327.24918-18-francis.laniel@amarulasolutions.com> In-Reply-To: <20211231161327.24918-18-francis.laniel@amarulasolutions.com> From: Simon Glass Date: Wed, 12 Jan 2022 13:03:40 -0700 Message-ID: Subject: Re: [RFC PATCH v1 17/21] cli: hush_2021: Enable using \< and \> as string compare operators. To: Francis Laniel Cc: U-Boot Mailing List , Marek Behun , Michael Nazzareno Trimarchi , Wolfgang Denk , Harald Seiler Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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 Hi Francis, On Fri, 31 Dec 2021 at 09:14, Francis Laniel wrote: > > In Busybox hush, '<' and '>' are used as redirection operators. > For example, cat foo > bar will write content of file foo inside file bar. > In U-Boot, we do not have file system, so we can hardly redirect command output > inside a file. > > But, in actual U-Boot hush, these operators ('<' and '>') are used as string > compare operators. > For example, test aaa < bbb returns 0 as aaa is before bbb in the dictionary. > Busybox hush also permits this, but operators need to be escaped ('\<' and > '\>'), so we stick here to this behavior. > Also, if escaping is needed it permits the developer to think about its code, as > in a lot of case, we want to compare integers (using '-lt' or '-gt') rather than > strings. > > Signed-off-by: Francis Laniel > --- > common/cli_hush_2021_upstream.c | 28 +++++++++++++++++++++++++++- > 1 file changed, 27 insertions(+), 1 deletion(-) Reviewed-by: Simon Glass We should add a file interface to U-Boot. Is that the only impediment to implementing redirection? I thought the problem was lack of fork() ? Regards, Simon