Skip to content

Commit 255889b

Browse files
Use "/usr/bin/env bash" for all shell scripts
This commit changes the shells to #!/usr/bin/env bash. Signed-off-by: Thales Antunes de Oliveira Barretto <thales.barretto.git@gmail.com> Add missing test cases to bash
1 parent a9f3973 commit 255889b

947 files changed

Lines changed: 1302 additions & 959 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/examples/autogen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22

33
aclocal
44
autoconf

autogen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22

33
echo
44
echo ... GlusterFS autogen ...

build-aux/config.guess.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22
#
33
# This script is intentionally left empty. Distributions that package GlusterFS
44
# may want to to replace it with an updated copy from the automake project.

build-aux/config.sub.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22
#
33
# This script is intentionally left empty. Distributions that package GlusterFS
44
# may want to to replace it with an updated copy from the automake project.

build-aux/pkg-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# To override version/release from git,
44
# create VERSION file containing text with version/release

extras/LinuxRPM/make_glusterrpms

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22

33
(
44
cd $(realpath $(dirname $0))/../.. || exit 1

extras/Solaris/checkinstall

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22
#
33
expected_platform="i386"
44
#

extras/backend-cleanup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# This script can be used to cleanup the 'cluster/distribute' translator's
44
# stale link files. One may choose to run this only when number of subvolumes

extras/backend-xattr-sanitize.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22

33
# Each entry in the array below is a regular expression to match stale keys
4-
54
xs=("trusted.glusterfs.createtime"
65
"trusted.glusterfs.version"
76
"trusted.glusterfs.afr.data-pending"
@@ -10,10 +9,12 @@ xs=("trusted.glusterfs.createtime"
109

1110
absolute_path()
1211
{
13-
local dir=$(dirname "$1");
14-
local base=$(basename "$1");
12+
local dir
13+
local base
14+
dir=$(dirname "$1");
15+
base=$(basename "$1");
1516
cd "$dir";
16-
echo $(pwd)/"$base";
17+
echo "$(pwd)/$base";
1718
cd - >/dev/null;
1819
}
1920

@@ -23,9 +24,9 @@ cleanup()
2324
sanitizee=$(absolute_path "$1");
2425

2526
stale_keys=$(
26-
for pattern in ${xs[@]}; do
27+
for pattern in "${xs[@]}"; do
2728
getfattr -d -m "$pattern" "$sanitizee" 2>/dev/null |
28-
grep = | cut -f1 -d=;
29+
grep -e '=' | cut -f1 -d '=';
2930
done
3031
)
3132

@@ -45,7 +46,7 @@ crawl()
4546
this_script=$(absolute_path "$0");
4647

4748
export sanitize=yes;
48-
find "$1" -exec "$this_script" {} \;
49+
find "$1" \( -exec "$this_script" {} \; \)
4950
}
5051

5152

extras/benchmarking/launch-script.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22

33
# This script is to launch the script in parallel across all the nodes.
44

@@ -8,7 +8,7 @@ path_to_script="$mount_point}/benchmark/local-script.sh"
88
num_hosts=8
99

1010
for i in $(seq 1 $num_hosts); do
11-
ssh node$i path_to_script &
11+
ssh "node${i}" path_to_script &
1212
done
1313

1414
sleep 3;

0 commit comments

Comments
 (0)