Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp182210rdb; Tue, 16 Jan 2024 21:00:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IEnNZGWWQkW9L7QX+S2REDq3E18XZ524wicMuzaNdqJecNqQ90yJHJP1rAtl8N8Oe7jo/kx X-Received: by 2002:aa7:d802:0:b0:558:857a:fe0 with SMTP id v2-20020aa7d802000000b00558857a0fe0mr4239919edq.70.1705467644403; Tue, 16 Jan 2024 21:00:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705467644; cv=pass; d=google.com; s=arc-20160816; b=02AAJiIq93QH7umn1ePSWII1aPx1Z5uPcQvBXWuV85yJvwk1MI7nUKJ7c0ZDsa4vFZ Txm3+CipuPhAEZ4d0fWXdSaCErNDvhiUhttCHvPVUeSe0eX3M6C3lbWb62YQ4ePg0s9L OhMwqrxDP6Voal6wTYWni4FLuNB1tjdMAQzyNGlskCCoPEl8I9l1v6DhNJL/fW2VZqxX C4FlLSYE1zz//omplcVXp/OTUMVk8Q/SLj7D22aznEAQsdSzL0Nojafmy89yLis8XJ93 cGmCrbUJ0vfpORn6RiuXFb8r3zznhnT4mnFJojrzY22ONYxDfBa+abltm2SdW6ztC79x +Cow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:cc:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=1zxNC559dfRs3YH8NYtW7aCgyNuEmvy1lh86IHQbS04=; fh=g42PGL8buxRFkWHROzXAkHgbAQ6Cw63AEsTlTzXndeA=; b=x3cfm3zi9b5QazDuOjN1EcPTBNHRfjYqlKoa4V2HqECTqRu4wKVhZyOXGtcPJK+2RC CGBW+wwtXPlyGIDV38DfumrfNzfWVUyo4DUUjKlz7e0mnIk2oqSNaL+tuB59ddkxVcom M5hReqWFkyJ39p0w9fu5wCnzxIrG9CQtDPIE+APOse5XqazXxTqz2cxBoxArErl+fNpE fJulZG0YUg7OnJx6uuBGI6js1NygC9IZHc0A25iL1r8aOdl7xK/uRITmGvunU3m9HiWx ATLZ+Zc0nGd2U2jggHrSt+DMpjhutMH2nir50dDXHh1W8cij/ua05COWnq/4wd5nKV22 oa8w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=j98ufzQX; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-28522-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28522-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c11-20020a509f8b000000b00559e1f21920si51751edf.573.2024.01.16.21.00.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 21:00:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28522-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=j98ufzQX; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-28522-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28522-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.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 27DF11F24D9E for ; Wed, 17 Jan 2024 05:00:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D3C46AD6; Wed, 17 Jan 2024 05:00:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="j98ufzQX" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 3ECB31C0F; Wed, 17 Jan 2024 05:00:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705467634; cv=none; b=apBwZFaDP3G8lSIUOJXfEQepe4ZO0L+FBp7V9FexnAnZXYnIxX6yGXw0cWHoDVffI+K4+luyowSvyku5umz2AMp1OoFUKXCEfeLPQFjhvbNuOp3hnsiH2TrH9+lXgeLJ2dOkhsyIAo2NEKZRri+Q0nBb7LhaY9HTS/kUfSYEG4E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705467634; c=relaxed/simple; bh=zULSsRwTQq8k5rydVDaY+DT96t5URjDNTyZA/KomP58=; h=DKIM-Signature:Received:Message-ID:Date:MIME-Version:User-Agent: Cc:Subject:Content-Language:To:References:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; b=BC3XtgzYHM/x+bHQH6smAOE1AsXRCTebqU9R3/APnLoMCrI3j+4A6osCYxcE445H5ge0iz1lYqITH7/d0FTfBy1Gx1m/H3UFbUNNq0yoQIpn/t6a9h60VhQyQcBow4IrSSbdphzg+YQAbI4pGyTq59vEdKyYLFyP2nTx1S0n9JU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=j98ufzQX; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1705467631; bh=zULSsRwTQq8k5rydVDaY+DT96t5URjDNTyZA/KomP58=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=j98ufzQX43Ks4+QXuqTCA+FMbw1Gr0KuHxDORHQ0W1A/xDete07+1DgDqrKcywrzJ Oep/Az7gugCKeEYMTIv5UyT0X3h1xwfmbuAuqKy+kCxe4QP3Ut9qrZ7r6i5isF2wcO xCzGxSxCvp4F5CpeSwBFviaT+j23PhyNNJrobi9pPqasRbxoAjeFPlJ12KX79Hqm5F GOwe+Hg53vBxIWIKO1Vb5nthbc80SYi4qo2ieYsnlHrMQdV2AlpKFxrVgqjKDVq6zx MoyRYXsfGNKPiay9lk+NdD0E8P7D4dLfKDvL9cN+nNOrH5fEQfEKgbZr6O6zAPht0w QmOZfmUxbAe0g== Received: from [100.96.234.34] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 79914378206D; Wed, 17 Jan 2024 05:00:29 +0000 (UTC) Message-ID: Date: Wed, 17 Jan 2024 10:00:38 +0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: Muhammad Usama Anjum , "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 Content-Language: en-US To: David Laight , Andrew Morton , Shuah Khan References: <20240116090455.3407378-1-usama.anjum@collabora.com> <0d5811eafd00496d98e88afe847fb8be@AcuMS.aculab.com> From: Muhammad Usama Anjum In-Reply-To: <0d5811eafd00496d98e88afe847fb8be@AcuMS.aculab.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/16/24 9:52 PM, David Laight wrote: > From: Muhammad Usama Anjum >> Sent: 16 January 2024 09:05 >> >> Running charge_reserved_hugetlb.sh generates errors if sh is set to >> dash: >> >> /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 >> >> 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? The Bash is being used in all or most of the selftests. I'd seen other similar [1][2] patches floating around which are converting /bin/sh (pointing to dash) to /bin/bash. [1] https://lore.kernel.org/linux-kselftest/20240110141436.157419-2-bpoirier@nvidia.com/ [2] https://lore.kernel.org/linux-kselftest/20231229131931.3961150-1-yujie.liu@intel.com/ > 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. > > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales) > > -- BR, Muhammad Usama Anjum