Skip to contentSkip to conversation

tools/slabinfo-gnuplot: force to use bash shell

PATCH In review Liu, Changcheng 5 participants 5 messages Dec 8, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/slabinfo-gnuplot: force to use bash shell

On some linux distributions, the default link of sh is dash which deoesn't support split array like ${var//,/ }
It's better to force to use bash shell directly.

tools/vm/slabinfo-gnuplot.sh +1 -1
index 35b0398..0cf28aa 100644
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # Sergey Senozhatsky, 2015
 # [email protected]
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Changcheng

On some linux distributions, the default link of sh is dash which deoesn't support split array like ${var//,/ }
It's better to force to use bash shell directly.

	-ss
Quoted 13 lines
tools/vm/slabinfo-gnuplot.sh +1 -1
index 35b0398..0cf28aa 100644
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # Sergey Senozhatsky, 2015
 # [email protected]
Signature · 1 line
2.7.4
#2 lore raw
Quoted 10 lines · On Fri, 8 Dec 2017 19:33:15 +0900 Sergey Senozhatsky…
Quoted 7 lines · Changcheng

On some linux distributions, the default link of sh is dash which deoesn't support split array like ${var//,/ }
It's better to force to use bash shell directly.

It would be better to rewrite the script to avoid bashisms. But...

akpm3:/usr/src/linux-4.15-rc2> grep -rl "/bin/bash" . | wc -l 164

I guess we lost that fight a long time ago.

#3 lore raw
Quoted 11 lines · Andrew Morton
Quoted 9 lines · On Fri, 8 Dec 2017 19:33:15 +0900 Sergey Senozhatsky…
Quoted 7 lines · Changcheng

On some linux distributions, the default link of sh is dash which deoesn't support split array like ${var//,/ }
It's better to force to use bash shell directly.

Quoted 8 lines
Quoted 1 line

It would be better to rewrite the script to avoid bashisms. But...

akpm3:/usr/src/linux-4.15-rc2> grep -rl "/bin/bash" . | wc -l 164

I guess we lost that fight a long time ago.

103 of those are in tools/ and I don't think those count. If you take out samples/ and Documentation/ it's down to 24.

#4 lore raw
In reply to Andrew Morton
Quoted 7 lines · Andrew Morton
Quoted 7 lines · Changcheng
Quoted 6 lines

On some linux distributions, the default link of sh is dash which deoesn't support split array like ${var//,/ }
It's better to force to use bash shell directly.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

It would be better to rewrite the script to avoid bashisms.

Hello Andrew,
what are the latest fashion trends? isn't it perl? so maybe I can sit down someday and rewrite it in perl.

	-ss