Skip to contentSkip to conversation

scripts: use env to invoke bash

PATCH New Himanshu Chauhan 3 participants 3 messages Dec 9, 2022 – Dec 10, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 scripts: use env to invoke bash

Not all systems have bash at a fixed location like /bin/bash. FreeBSD, for example, would typically have it at /usr/local/bin/bash. When building OpenSBI on freebsd system, the build breaks.

Its advisable to use: #!/usr/bin/env bash

[v2] In this version:
* Change remaining two scripts to use env

---
 scripts/carray.sh                | 2 +-
 scripts/create-binary-archive.sh | 2 +-
 scripts/d2c.sh                   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
scripts/carray.sh +1 -1
index 0c52bd6..13f9d36 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 function usage()
 {
scripts/create-binary-archive.sh +1 -1
index 261a45a..63781e1 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 function usage()
 {
scripts/d2c.sh +1 -1
index 33a3ccf..c411fcd 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 function usage()
 {
Signature · 1 line
2.38.1
#1 lore raw

PATCH v2 1/1 scripts: use env to invoke bash

? 2022-12-09???? 11:43 +0530?Himanshu Chauhan???

Quoted 10 lines

Not all systems have bash at a fixed location like /bin/bash. FreeBSD, for example, would typically have it at /usr/local/bin/bash. When building OpenSBI on freebsd system, the build breaks.

Its advisable to use: #!/usr/bin/env bash

[v2] In this version:
* Change remaining two scripts to use env

LGTM

Quoted 40 lines

---

?scripts/carray.sh??????????????? | 2 +-
?scripts/create-binary-archive.sh | 2 +-
?scripts/d2c.sh?????????????????? | 2 +-

?3 files changed, 3 insertions(+), 3 deletions(-)

scripts/carray.sh +1 -1
index 0c52bd6..13f9d36 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash

?
?function usage()
?{

scripts/create-binary-archive.sh +1 -1
index 261a45a..63781e1 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash

?
?function usage()
?{

scripts/d2c.sh +1 -1
index 33a3ccf..c411fcd 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash

?
?function usage()
?{

Signature · 1 line
2.38.1
Applied
#2 lore raw

PATCH v2 1/1 scripts: use env to invoke bash

In reply to Himanshu Chauhan
Quoted 9 lines · Himanshu Chauhan

Not all systems have bash at a fixed location like /bin/bash. FreeBSD, for example, would typically have it at /usr/local/bin/bash. When building OpenSBI on freebsd system, the build breaks.

Its advisable to use: #!/usr/bin/env bash

[v2] In this version:
* Change remaining two scripts to use env

The change log should be after the "---" line below for a single patch otherwise it becomes part of the commit description.

Quoted 2 lines

Looks good to me.

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

Quoted 44 lines
---
 scripts/carray.sh                | 2 +-
 scripts/create-binary-archive.sh | 2 +-
 scripts/d2c.sh                   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
scripts/carray.sh +1 -1
index 0c52bd6..13f9d36 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 function usage()
 {
scripts/create-binary-archive.sh +1 -1
index 261a45a..63781e1 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 function usage()
 {
scripts/d2c.sh +1 -2
index 33a3ccf..c411fcd 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 function usage()
 {
--

2.38.1

--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi