Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1n3s9o-0007n0-4f for mharc-grub-devel@gnu.org; Sat, 01 Jan 2022 23:07:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3s9m-0007iL-An for grub-devel@gnu.org; Sat, 01 Jan 2022 23:07:42 -0500 Received: from [2607:f8b0:4864:20::72d] (port=40882 helo=mail-qk1-x72d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n3s9k-00025p-Vm for grub-devel@gnu.org; Sat, 01 Jan 2022 23:07:42 -0500 Received: by mail-qk1-x72d.google.com with SMTP id w27so22165698qkj.7 for ; Sat, 01 Jan 2022 20:07:40 -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=jIzlH9QRAm8u4tsP4/5Ja9yuBnRgn7trXapzBgxlH7CSaSAM6YAdspuWHd/jftQOPF Tsx1dikQcWP0iduxEDHQ2gKhPgfmCuyhcnM1p6y3jlustWJwuZY7CgPU+xyeLldG66dC S0si3keQoJz/efecTNMVvFg/P0l3Nd7pFEghxqIK7/d9b2epj/5XVtHN5g/ZeJh2vv1B 0QZQNs+joMkHBRa6cqdyrboVa8G4uY6aOttxrwQc0WFolqc9E8LQFWTNG4sGSnpE628P HH6g8YHdCFfhB+2LRhEleVoidFhNgk4+JLIUipJJCio64gza+Y5Cjot13Ys7RlUGbJza s3Iw== 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=J0FdBv1aIjtBTPmVwp7nnQRquPW3F68tQeUCD8JlphTQUXqjWv7mv7yfhlJUTNLOuH Fmq9raoK7Qdw9Dgy0ABqRPpFqApHkG0czrJWx6gdMvrowmLApLejlNNaHGKAN5l4ulYV AU+Gc5VGCcziDDa2hh1fJI5sYw4S/StT4e5lmewtRPwzs6SN4Jz9RNYZbkM5ARfQJR23 UVrbZTU9R3+7l0pC59rCYI3xKgFo2X5sWsMwVyBLfaPS697ja0bTLFUbpFfrQPT9tPNG of7m/k1W8dr6dUv4s/QoqJqalK+HA/gQvDjnfquqg+fgjmPILQkCHzCWmAK8Vnyl/4ul WfVQ== X-Gm-Message-State: AOAM531tbjQJKgCesy1Zlip9bV03av04KYA6Ww/Aepda9HN4fMNsTpek CJyc7UxVJV8h7teJfxQeR49+nQ== X-Google-Smtp-Source: ABdhPJyuWwuWPYCYv+7KMb4ASrGuHqttU8Gp090O07EYGNtZZT/jSj2+/1LGwOVFsOckSwJ+kAtBLA== X-Received: by 2002:a05:620a:440e:: with SMTP id v14mr25353082qkp.164.1641096460150; Sat, 01 Jan 2022 20:07:40 -0800 (PST) Received: from localhost.localdomain ([37.218.244.251]) by smtp.gmail.com with ESMTPSA id 137sm22660725qkm.69.2022.01.01.20.07.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jan 2022 20:07:39 -0800 (PST) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org Cc: Glenn Washburn Subject: [PATCH v2 02/12] grub-shell: Trim line should always be matched from the beginning of the line Date: Sat, 1 Jan 2022 22:07:12 -0600 Message-Id: <7c8264aebe96e67e5af0f0073c2c482145766b20.1641095841.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::72d (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::72d; envelope-from=development@efficientek.com; helo=mail-qk1-x72d.google.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: Sun, 02 Jan 2022 04:07: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