diff mbox series

[scarthgap,3/3] base-files: profile: fix error sh: 1: unknown operand

Message ID 20240612023909.1493286-3-pkj@axis.com
State Under Review
Delegated to: Steve Sakoman
Headers show
Series [scarthgap,1/3] devtool: modify: Catch git submodule error for go code | expand

Commit Message

Peter Kjellerstedt June 12, 2024, 2:39 a.m. UTC
From: Felix Nilsson <felixn@axis.com>

Handle errors when SHLVL isn't set.

Signed-off-by: Felix Nilsson <felixn@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 5df53fcfe3b70a5312fced3fcc1ba6290f2ee794)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 meta/recipes-core/base-files/base-files/profile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
index bded3757cc..5e8393c91c 100644
--- a/meta/recipes-core/base-files/base-files/profile
+++ b/meta/recipes-core/base-files/base-files/profile
@@ -58,7 +58,7 @@  resize() {
 	fi
 	# only do this for /dev/tty[A-z] which are typically
 	# serial ports
-	if [ $FIRSTTIMESETUP -eq 1 -a $SHLVL -eq 1 ] ; then
+	if [ $FIRSTTIMESETUP -eq 1 -a ${SHLVL:-1} -eq 1 ] ; then
 		case $(tty 2>/dev/null) in
 			/dev/tty[A-z]*) resize >/dev/null;;
 		esac