From: Felix Nilsson Date: Mon, 20 May 2024 08:29:28 +0000 (+0200) Subject: base-files: profile: fix error sh: 1: unknown operand X-Git-Tag: uninative-4.6~535 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5df53fcfe3b70a5312fced3fcc1ba6290f2ee794;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git base-files: profile: fix error sh: 1: unknown operand Handle errors when SHLVL isn't set. Signed-off-by: Felix Nilsson Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile index bded3757cc1..5e8393c91c6 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