All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/slabinfo-gnuplot: force to use bash shell
@ 2017-12-08  9:37 Liu, Changcheng
  2017-12-08 10:33 ` Sergey Senozhatsky
  0 siblings, 1 reply; 5+ messages in thread
From: Liu, Changcheng @ 2017-12-08  9:37 UTC (permalink / raw)
  To: sergey.senozhatsky; +Cc: linux-kernel, akpm, changcheng.liu

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.

Signed-off-by: Liu Changcheng <changcheng.liu@intel.com>

diff --git a/tools/vm/slabinfo-gnuplot.sh b/tools/vm/slabinfo-gnuplot.sh
index 35b0398..0cf28aa 100644
--- a/tools/vm/slabinfo-gnuplot.sh
+++ b/tools/vm/slabinfo-gnuplot.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # Sergey Senozhatsky, 2015
 # sergey.senozhatsky.work@gmail.com
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] tools/slabinfo-gnuplot: force to use bash shell
  2017-12-08  9:37 [PATCH] tools/slabinfo-gnuplot: force to use bash shell Liu, Changcheng
@ 2017-12-08 10:33 ` Sergey Senozhatsky
  2017-12-08 22:02   ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Sergey Senozhatsky @ 2017-12-08 10:33 UTC (permalink / raw)
  To: Liu, Changcheng; +Cc: sergey.senozhatsky, linux-kernel, akpm

On (12/08/17 17:37), Liu, Changcheng wrote:
> 
> 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.
> 
> Signed-off-by: Liu Changcheng <changcheng.liu@intel.com>

Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>


	-ss

> diff --git a/tools/vm/slabinfo-gnuplot.sh b/tools/vm/slabinfo-gnuplot.sh
> index 35b0398..0cf28aa 100644
> --- a/tools/vm/slabinfo-gnuplot.sh
> +++ b/tools/vm/slabinfo-gnuplot.sh
> @@ -1,4 +1,4 @@
> -#!/bin/sh
> +#!/bin/bash
>  
>  # Sergey Senozhatsky, 2015
>  # sergey.senozhatsky.work@gmail.com
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tools/slabinfo-gnuplot: force to use bash shell
  2017-12-08 10:33 ` Sergey Senozhatsky
@ 2017-12-08 22:02   ` Andrew Morton
  2017-12-08 22:20     ` Joe Perches
  2017-12-08 23:59     ` Sergey Senozhatsky
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Morton @ 2017-12-08 22:02 UTC (permalink / raw)
  To: Sergey Senozhatsky; +Cc: Liu, Changcheng, sergey.senozhatsky, linux-kernel

On Fri, 8 Dec 2017 19:33:15 +0900 Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> wrote:

> On (12/08/17 17:37), Liu, Changcheng wrote:
> > 
> > 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.
> > 
> > Signed-off-by: Liu Changcheng <changcheng.liu@intel.com>
> 
> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tools/slabinfo-gnuplot: force to use bash shell
  2017-12-08 22:02   ` Andrew Morton
@ 2017-12-08 22:20     ` Joe Perches
  2017-12-08 23:59     ` Sergey Senozhatsky
  1 sibling, 0 replies; 5+ messages in thread
From: Joe Perches @ 2017-12-08 22:20 UTC (permalink / raw)
  To: Andrew Morton, Sergey Senozhatsky
  Cc: Liu, Changcheng, sergey.senozhatsky, linux-kernel

On Fri, 2017-12-08 at 14:02 -0800, Andrew Morton wrote:
> On Fri, 8 Dec 2017 19:33:15 +0900 Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> wrote:
> 
> > On (12/08/17 17:37), Liu, Changcheng wrote:
> > > 
> > > 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.
> > > 
> > > Signed-off-by: Liu Changcheng <changcheng.liu@intel.com>
> > 
> > Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> 
> 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tools/slabinfo-gnuplot: force to use bash shell
  2017-12-08 22:02   ` Andrew Morton
  2017-12-08 22:20     ` Joe Perches
@ 2017-12-08 23:59     ` Sergey Senozhatsky
  1 sibling, 0 replies; 5+ messages in thread
From: Sergey Senozhatsky @ 2017-12-08 23:59 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Sergey Senozhatsky, Liu, Changcheng, sergey.senozhatsky, linux-kernel

On (12/08/17 14:02), Andrew Morton wrote:
> > On (12/08/17 17:37), Liu, Changcheng wrote:
> > > 
> > > 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.
> > > 
> > > Signed-off-by: Liu Changcheng <changcheng.liu@intel.com>
> > 
> > Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> 
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-12-08 23:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08  9:37 [PATCH] tools/slabinfo-gnuplot: force to use bash shell Liu, Changcheng
2017-12-08 10:33 ` Sergey Senozhatsky
2017-12-08 22:02   ` Andrew Morton
2017-12-08 22:20     ` Joe Perches
2017-12-08 23:59     ` Sergey Senozhatsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.