Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lCw1Z-0006Du-PK for mharc-grub-devel@gnu.org; Thu, 18 Feb 2021 22:00:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCw1X-00069S-Bk for grub-devel@gnu.org; Thu, 18 Feb 2021 22:00:07 -0500 Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]:39424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lCw1T-0005VP-Oq for grub-devel@gnu.org; Thu, 18 Feb 2021 22:00:06 -0500 Received: by mail-qt1-x836.google.com with SMTP id e11so3041363qtg.6 for ; Thu, 18 Feb 2021 19:00:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WGaDZYvJ06nMhFsT3NpAoDvyYQGsRkbAXipegDqoiEA=; b=e/YPFRtPqOMfpnuBsRFRyQd/NHw+fBspO94mcS6bUxAEzgYzg1D9EHKOaKYVSp/iRW tgBzH7bbXAYOHsFY5cGEstPgC/sNKh8cfFXzw+15fh2yDH3S+FBgf4vajRRAD7sJGlsJ 69X1B7ZwbLeq9ScQhtESjJ/I+ouAOfFvOl0VSgWOgLVrmBEbF6wbQBuvzcPuV/+zImux lrEQA/esuj3wCW4SSt9YLCMFBYRD1uJy4b343NHqGm1a9Osg3BfQXWw9SHWwIKkuxqLe MgxDnOgEc8PNrSReXWcH+cnoqqg808LEfqrZm9eERULTmwlTl5LVwwwxTnl75aPRO97S stEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WGaDZYvJ06nMhFsT3NpAoDvyYQGsRkbAXipegDqoiEA=; b=l7dkwnFunvtykIUpPW5yMr8ynoXP8q9gRhvS5dhhvrXPZkDYgGAVQrn1QTtjxRRQ9g yOCGUV2M1Hb1+CH7DRVwxqtmgcGaSitTvIOGSrEEIz2JpK/V579od+D3nsA44tUQYw/+ rIGk/4XJABN0Qk/0zFLJqD2xxRRpnlAzuVb1s8MAW0F34PEq/7IpefelW4gcUZOpFQ1D WQ2JFIGiGqI5AxnVCVdJamm8YGTpvv2xxzXQcGO+m474ueO4jx3Li5IuN15xT9QOb0q9 i3RVbIk+QWKEX01bdEmH2xMfSAHnq1dCNEJflPRpkBGYDmPnLVRroiwrWsRb8dpcLWHp DLFw== X-Gm-Message-State: AOAM5322M6raYZDeudoXPOA+8HH6Pv7Aw36Q+EEowMjHqytQX2Vzk8n5 UKhgtsiYHBJNUmbjzNRY5rd+6abECtusLw== X-Google-Smtp-Source: ABdhPJxWzLtzOG6ULk70JCs62012gTotvuSgkhR5yxY4dM2o95JqPWv7smGZCsl9G9WQk91roDE7fQ== X-Received: by 2002:ac8:548d:: with SMTP id h13mr7297367qtq.315.1613703601240; Thu, 18 Feb 2021 19:00:01 -0800 (PST) Received: from localhost.localdomain ([2605:a601:aac5:3700:c323:c101:d96b:34f1]) by smtp.gmail.com with ESMTPSA id b17sm2468294qtq.56.2021.02.18.19.00.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Feb 2021 19:00:00 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org Cc: Daniel Kiper , Glenn Washburn Subject: [CI 06/17] grub-shell: Trim line should always be matched from the beginning of the line Date: Thu, 18 Feb 2021 20:59:25 -0600 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::836; envelope-from=development@efficientek.com; helo=mail-qt1-x836.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.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2021 03:00:08 -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