linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Muhammad Usama Anjum' <usama.anjum@collabora.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Shuah Khan <shuah@kernel.org>
Cc: "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: Tue, 16 Jan 2024 16:52:25 +0000	[thread overview]
Message-ID: <0d5811eafd00496d98e88afe847fb8be@AcuMS.aculab.com> (raw)
In-Reply-To: <20240116090455.3407378-1-usama.anjum@collabora.com>

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?
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)



  reply	other threads:[~2024-01-16 16:52 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 [this message]
2024-01-17  5:00   ` Muhammad Usama Anjum

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=0d5811eafd00496d98e88afe847fb8be@AcuMS.aculab.com \
    --to=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 \
    --cc=usama.anjum@collabora.com \
    /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