Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp567901rdb; Tue, 16 Jan 2024 08:53:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IHUcvazfKhl1T//SmTE4p7rkNEYMdm8RHMwyEB1LNxTuGwy6qLm0YBCIygw9L2gnLbzIL0w X-Received: by 2002:aa7:c143:0:b0:557:1211:bff4 with SMTP id r3-20020aa7c143000000b005571211bff4mr2762463edp.108.1705423982982; Tue, 16 Jan 2024 08:53:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705423982; cv=none; d=google.com; s=arc-20160816; b=Uxu+vZoFPoyLHHXf4TnA3QObLwlAixBeTCr1onmmUXnSo9hQHVeciEIVBYIQkwH35+ 6lo1d0eW7x906eG1cAMhcGVgZ0j/EcQiHrXjdkeuDCzHw6bMGXjqHAde5cdKVld8drbe zHpjmW56I2UowhZx1xZ0z32V9OJyIFzpUGRsmL0NYmY+M5//Yt0pViuDUenTy/kG6SjJ QK8m1MGF9FamnvbFEX8HVyczs2HFeHErl1g5vSb6UkxpWlrYvW+BvTEwo88MNP8JDksx o2/K77Lqg4n7tb1uaEjtqX8Futc6iCcoaaDGY5eM1Nba/rYOatmUJAlwlqkpvvXZ3Zgh fe/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=H1qKo0YD/yKydqWV36YqpCvWCMaWhygLdc6dUFN6lRI=; fh=r5/6qBsp8trJ1FIxMO5y3w44Op2+6w0bCIYCJGJXdKU=; b=aKqVR6pnBl4F6YT7dRsnN0AR+Kbmmdi2/HCHILUmIslQ8XOxOYIWpu5otIauZZNuJn StIvsfeM21AMl/q9f5BX2i/C8Ta4bsPb2s+oOay7eElbDXnsUaZoprZQhJw64dmyjG4B ehvMhPsWqp6z8v3qbcmtOusB5lvBuKvP0bNTeMBAkP+/4lFzTVsLh+TkbrTpnPutJ2A6 bj5Ub+c0Fzi7kyTe48dal4FP7i38KmwwxbgF6u2e4rXTkP3lnrQdvGCj9Pg48fy1yDiP BXDlnW2hYjdSw3/+Z1Ns9zjrngMMEvDrO21aKtkVh4zTgjs1V3OyyixS9Yd5Wbgkzi+y M75g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-27594-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27594-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u26-20020a056402065a00b005576f9db95csi5088609edx.407.2024.01.16.08.53.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 08:53:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27594-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-27594-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27594-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BA4451F23CC5 for ; Tue, 16 Jan 2024 16:53:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B69B1C6B7; Tue, 16 Jan 2024 16:52:53 +0000 (UTC) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7282F1CD00 for ; Tue, 16 Jan 2024 16:52:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aculab.com Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-78-CIr4UeMUOAeu9U8zNHxWyA-1; Tue, 16 Jan 2024 16:52:43 +0000 X-MC-Unique: CIr4UeMUOAeu9U8zNHxWyA-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 16 Jan 2024 16:52:25 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Tue, 16 Jan 2024 16:52:25 +0000 From: David Laight To: 'Muhammad Usama Anjum' , Andrew Morton , Shuah Khan CC: "kernel@collabora.com" , "linux-mm@kvack.org" , "linux-kselftest@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] selftests/mm: switch to bash from sh Thread-Topic: [PATCH] selftests/mm: switch to bash from sh Thread-Index: AQHaSFsmDX3I4Kn9G0+MfyGy1cAOzbDcpaTg Date: Tue, 16 Jan 2024 16:52:25 +0000 Message-ID: <0d5811eafd00496d98e88afe847fb8be@AcuMS.aculab.com> References: <20240116090455.3407378-1-usama.anjum@collabora.com> In-Reply-To: <20240116090455.3407378-1-usama.anjum@collabora.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable From: Muhammad Usama Anjum > Sent: 16 January 2024 09:05 >=20 > Running charge_reserved_hugetlb.sh generates errors if sh is set to > dash: >=20 > /charge_reserved_hugetlb.sh: 9: [[: not found > /charge_reserved_hugetlb.sh: 19: [[: not found > /charge_reserved_hugetlb.sh: 27: [[: not found > /charge_reserved_hugetlb.sh: 37: [[: not found > /charge_reserved_hugetlb.sh: 45: Syntax error: "(" unexpected >=20 > Switch to using /bin/bash instead of /bin/sh. Make the switch for > write_hugetlb_memory.sh as well which is called from > charge_reserved_hugetlb.sh. Why not just fix the script? Looks like most of the [[ ... ]] could be [ ... ] although some might need to be [ -n "$cgroup2" ]. The delete the 'function' keyword another bash-ism. It's not as though you are trying to run on a system when /bin/sh is a traditional (aka non-posix) bourne shell. =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)