Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nIHMp-0002JX-9m for mharc-grub-devel@gnu.org; Thu, 10 Feb 2022 16:52:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIHMk-0002GJ-Vz for grub-devel@gnu.org; Thu, 10 Feb 2022 16:52:40 -0500 Received: from [2607:f8b0:4864:20::735] (port=46706 helo=mail-qk1-x735.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIHMh-0008Cn-Ii for grub-devel@gnu.org; Thu, 10 Feb 2022 16:52:38 -0500 Received: by mail-qk1-x735.google.com with SMTP id 13so6345896qkd.13 for ; Thu, 10 Feb 2022 13:52:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WGaDZYvJ06nMhFsT3NpAoDvyYQGsRkbAXipegDqoiEA=; b=OxjqzmbZvUjnXE8jrmL9jA72280huaCqplR7SVYVpahWoLAkmacvaa+5ohyUWHF7Rg fAQskJsPYJ+tuk3K2yB0Y7W7pTPV6jsKPLaerOwIqPtNC5BN0YY1OeEt58O4+Jo0CU4j LAXii5Du4g1WCOJddfQNsCHVlXEN0uGzO8QUp4073tjZEwyiT+qj5m5BOhVxuazHP9zf jqiaMzcnvQ560G2SyU2gZuihynUKg2A1OwZGocr0cYGaDg1Qi7nCKpU3qNIerGajmdQP AgxyXgbvAnya8LK0yGERMwO+BXt8r07zCTKTrpC5WV/Wm7JOX7Dh8Slf8lPZ9PjhO+sy AEAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WGaDZYvJ06nMhFsT3NpAoDvyYQGsRkbAXipegDqoiEA=; b=VWONu13nnebqBh7cuuT09MjCqRq4995Ljq4paO7dedlO9D0YXD+obGBNlFjWYpOisE d8CHulmp9CpOwFI9cuY2oi4vATrQBbl2SSMjF9cTtgGb6tAgRj5Xles7GHH9ZEx0dlT2 xe8rak/7efJUydRv43KffulKamT3h4P7gSeKGAxhlv4lOGYx12gYDvz1s4qCVFlltU6+ pLE1wg9a7xEIdQgHwd6hc91Q/9j9kd/P2g86oE/Iu7wJ2ZuvkBdS1d40JNDYFE/h/Q/C 6uHpiSqGmXjTwM7hySnQE6r9yqmCq/pLk3YwEzcZgozYzXCzblvMIqRdv2BrQG9wSgVr s6Tg== X-Gm-Message-State: AOAM530GKDg5SVv591jYFfoXkKZ/Q/i2xMrHiyFaprXKF5iV5EJtQOnp EETH027iNHvDpaGyG5ezkosR5g== X-Google-Smtp-Source: ABdhPJxW5eSf9KS4K9u8DReDh8SYA8eCiuVGccEBVNaen+/BR4e2KQE+wPULGjCh0RjYHZ6Zn9Sg3g== X-Received: by 2002:a05:620a:a12:: with SMTP id i18mr4658397qka.695.1644529954767; Thu, 10 Feb 2022 13:52:34 -0800 (PST) Received: from localhost.localdomain (garza.riseup.net. [198.252.153.109]) by smtp.gmail.com with ESMTPSA id j15sm11740363qta.83.2022.02.10.13.52.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 13:52:34 -0800 (PST) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org Cc: Glenn Washburn Subject: [PATCH v3 02/15] grub-shell: Trim line should always be matched from the beginning of the line Date: Thu, 10 Feb 2022 15:51:19 -0600 Message-Id: <7c8264aebe96e67e5af0f0073c2c482145766b20.1644528774.git.development@efficientek.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::735 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::735; envelope-from=development@efficientek.com; helo=mail-qk1-x735.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Feb 2022 21:52:42 -0000 When turning on shell tracing the trim line will be output before we actually want to start the trim. However, in this case the trim line never starts from the beginning of the line. So start trimming from the correct line by matching from the beginning of the line. Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index b409962f1..602b16f3e 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -343,7 +343,7 @@ terminal_output ${term} EOF if [ $trim = 1 ]; then - echo "echo $trim_head" >>${cfgfile} + echo "echo; echo $trim_head" >>${cfgfile} fi rom_directory=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 @@ -457,7 +457,7 @@ fi do_trim () { if [ $trim = 1 ] || [ $trim = 2 ]; then - awk '{ if (have_head == 1) print $0; } /'"$trim_head"'/ { have_head=1; }' + awk '{ if (have_head == 1) print $0; } /^'"$trim_head"'/ { have_head=1; }' else cat fi -- 2.27.0