From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pFMoE-0005ON-QA for mharc-grub-devel@gnu.org; Tue, 10 Jan 2023 17:09:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFMoB-0005Nw-9g for grub-devel@gnu.org; Tue, 10 Jan 2023 17:09:27 -0500 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFMo9-0005co-16 for grub-devel@gnu.org; Tue, 10 Jan 2023 17:09:26 -0500 Received: by mail-il1-x12c.google.com with SMTP id o13so7100275ilc.7 for ; Tue, 10 Jan 2023 14:09:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FwGBNQxZVuXKojVwrrmvriAWAiD01jIFZABOQDxrS3c=; b=ElnUsDRDVjJTjEvZYhXhJrP+y1d7JVijPRuYwZPD0NRNyd+qSBVm93ORAfUNcIlfxb +bfoGEouaxXyacPqSKpyzB2M5xbqe32h4Jzh9/AZPVRlg77nc9K+7CHaGgjaiBDUtjVD r/0W0XpIXJZBMN5g1h44tT8G2jIIzfQOnboJiDsnAMgTrAorQgR5pOQ0Dh49cHlB/XRF Yk1Y2UwcXwG3h9GjEQUFQqNOYwcQEKYHOl0Y9VE92vZY9vjFZHMt/SHYunYQpBSRYEnH yCjnh2PiMaYhD4hmxh5o7UcZpzQ23LC93qIPoZYhhLM5+S3qXPvd0qbY0DRTQ4ZXnKuR IMww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FwGBNQxZVuXKojVwrrmvriAWAiD01jIFZABOQDxrS3c=; b=HC6iNA7mL31200EaQ2z/29qrQvoFLCcUoGWauho8hIr8TJWoAFCkRkIypZ4QkkyFLy 1/YBS61cTmpBdJQGI3Bm1/xU4GOfvmRQwVzMprnDcaACxpXt8DLq7RRZoOgfmpNUziEr 5rZ/sWbYEW657/pCe8KEnr4cbKQj9Z7oVgtuW4qBF/XGuYjDJ+86aCbXWkXd/Yk8Bvcb s9VHX6NeEsHPsRkkSVPtrI+uy7h1oXescX2stNNCC1Gxw+NlfXeayHVSKv0IrkgNp71M wr+ZPIup4eKD/RTN/ik+wKDYvWlW8y4YSJVtoO8+NaJEp1RXBxJIbBalFo9JitKsxpoS j1mg== X-Gm-Message-State: AFqh2koMdxTZ0tEKLxHK24/KANQr/uoppj/AZ4TVMPoHY+wrmDXecm1M DqbOKjAD1GBZNkz1qfM+2m6cLM5dmkRWorj2 X-Google-Smtp-Source: AMrXdXuRswbBRofG8NZCTkXRJUOfBnKTz25bKJ7i6yJS0wnrutCc5NpaZinjsLWa+B4ehEvA8Mc9YA== X-Received: by 2002:a92:6b03:0:b0:303:8cff:983b with SMTP id g3-20020a926b03000000b003038cff983bmr48471336ilc.14.1673388563993; Tue, 10 Jan 2023 14:09:23 -0800 (PST) Received: from crass-HP-ZBook-15-G2.lan ([199.254.238.56]) by smtp.gmail.com with ESMTPSA id c3-20020a029603000000b0038ac01fb3bcsm3980811jai.14.2023.01.10.14.09.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 14:09:23 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Patrick Steinhardt , Glenn Washburn Subject: [PATCH 4/6] grub-shell: Trim line should always be matched from the beginning of the line Date: Tue, 10 Jan 2023 16:08:58 -0600 Message-Id: <20230110220900.1248367-5-development@efficientek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230110220900.1248367-1-development@efficientek.com> References: <20230110220900.1248367-1-development@efficientek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::12c; envelope-from=development@efficientek.com; helo=mail-il1-x12c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: Tue, 10 Jan 2023 22:09:28 -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 585f0d066e..f41e1a0b68 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -360,7 +360,7 @@ terminal_output ${term} EOF if [ $trim = 1 ]; then - echo "echo $trim_head" >>${cfgfile} + echo "echo; echo $trim_head" >>${cfgfile} fi rom_directory="$work_directory/rom_directory" @@ -484,7 +484,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.34.1