linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: David Laight <David.Laight@ACULAB.COM>,
	Andrew Morton <akpm@linux-foundation.org>,
	Shuah Khan <shuah@kernel.org>
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>,
	"kernel@collabora.com" <kernel@collabora.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kselftest@vger.kernel.org"
	<linux-kselftest@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] selftests/mm: switch to bash from sh
Date: Wed, 17 Jan 2024 10:00:38 +0500	[thread overview]
Message-ID: <fe1334e0-406b-40e4-b0e3-1c93a6764d99@collabora.com> (raw)
In-Reply-To: <0d5811eafd00496d98e88afe847fb8be@AcuMS.aculab.com>

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


      reply	other threads:[~2024-01-17  5:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16  9:04 Muhammad Usama Anjum
2024-01-16 16:52 ` David Laight
2024-01-17  5:00   ` Muhammad Usama Anjum [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe1334e0-406b-40e4-b0e3-1c93a6764d99@collabora.com \
    --to=usama.anjum@collabora.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=akpm@linux-foundation.org \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox