From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lRmb8-0006eH-Cq for mharc-grub-devel@gnu.org; Wed, 31 Mar 2021 21:58:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRmb6-0006d3-3r for grub-devel@gnu.org; Wed, 31 Mar 2021 21:58:12 -0400 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]:44981) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lRmaz-0007HN-78 for grub-devel@gnu.org; Wed, 31 Mar 2021 21:58:10 -0400 Received: by mail-oi1-x233.google.com with SMTP id a8so247457oic.11 for ; Wed, 31 Mar 2021 18:58:04 -0700 (PDT) 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=iOPH+D2vupeLKcv/eUmJmxLXORAfkXJZbuscjCfSBzfelgqdjjDO2DJhBqKWyUTJwi Tr4E+N9r1VZS/fgrFt5KDzS1wss8AeNmU/7lZYLF/Sp43BvkRO/yuc65csEwaxru0iE0 GzUYTYo9vAfOmFJvYHdGqZ48/LPTTPo23mCN70QOY/Gh9H+niJXtNEUVRyYcvvjK1Eyu hAdJnohPk+HD6trJwJnt08VR3FVjKjshAZXjeZ6To1IwWr5UwIJ6QWjzrSXpFcebfQYV R5J7hq+pIe/AzDMGxXB5ewNZptHiaBGfWjp1D2Pqk4ip0B+Lf2k6KRcd/Glukl3vvI2e Kc0w== 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=pG3PHo2fJws/ca302+Bm2NVjy6xYQwdOIx3cRV7etdXLG+BqTNrK5ftymniggGTunB YHdYKB32XIvk1dkfGTSftzk9qIRTzLrveyBO1nFHg+qS/vDVEbFRMF1/KhiChQKqGVnA q9iHJjSw/XLXQ/YRBGjZmv148QtP65MDwUPtpK1oUfOp24lrpYmq9FUVCt/fWna4T3fv kzordGoG3WTA3N3Vk//MNrZWwCtzo5ilLbp1aVgHdWm1nW5+4IpAWP9r4AMN77ty1gi5 s6OZ623Uo6mYx3k+wvE1+Vc8b/T4fli53UirZ1aFTh9wBNrmLdYaQa2dEYty6IcPnXJY 3fWQ== X-Gm-Message-State: AOAM531y8LB7F6b1f3k5ZZmLyCgLy9raMDtMpxhyPJwb7risOWwQob2g In337Mm956qbCAq+IenH6j+11uyAXQRGSg== X-Google-Smtp-Source: ABdhPJzRUWN7uBXz1Sn6PQekBSmpZGpNWWI4JI4IVxP8gaMZs3V8FeIal2kH9n8rPOuur1qXOOcnHQ== X-Received: by 2002:aca:3d86:: with SMTP id k128mr4232708oia.86.1617242283931; Wed, 31 Mar 2021 18:58:03 -0700 (PDT) Received: from localhost.localdomain ([2605:a601:ab16:db00:1cb0:2038:b70a:65b5]) by smtp.gmail.com with ESMTPSA id z25sm902960otj.68.2021.03.31.18.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 18:58:03 -0700 (PDT) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Glenn Washburn Subject: [PATCH 02/12] grub-shell: Trim line should always be matched from the beginning of the line Date: Wed, 31 Mar 2021 20:57:41 -0500 Message-Id: <34ce888868c392ed1ec643fac60b32b5cad1a67c.1617240986.git.development@efficientek.com> 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::233; envelope-from=development@efficientek.com; helo=mail-oi1-x233.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: Thu, 01 Apr 2021 01:58:12 -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