All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix recommended test command
@ 2012-11-17 12:37 Gilles Espinasse
  2012-11-18 23:03 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: Gilles Espinasse @ 2012-11-17 12:37 UTC (permalink / raw)
  To: linux-raid, neilb; +Cc: Gilles Espinasse

Signed-off-by: Gilles Espinasse <g.esp@free.fr>

Recommended 'sh ./test' fail with
LANG=C sudo sh ./test
./test: line 73: `ctrl-c': not a valid identifier

Replace '-' by '_' in the ctrl-c function name fix that.
In the same time, update the recommended command to 'bash ./test' to match the shebang
---
 Makefile |    2 +-
 test     |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index d99ea2b..94229fa 100644
--- a/Makefile
+++ b/Makefile
@@ -268,7 +268,7 @@ uninstall:
 	rm -f $(DESTDIR)$(MAN8DIR)/mdadm.8 $(DESTDIR)$(MAN8DIR)/mdmon.8 $(DESTDIR)$(MAN4DIR)/md.4 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 $(DESTDIR)$(BINDIR)/mdadm
 
 test: mdadm mdmon test_stripe swap_super
-	@echo "Please run 'sh ./test' as root"
+	@echo "Please run 'bash ./test' as root"
 
 clean : 
 	rm -f mdadm mdmon $(OBJS) $(MON_OBJS) $(STATICOBJS) core *.man \
diff --git a/test b/test
index 3f8515f..a3c2a24 100755
--- a/test
+++ b/test
@@ -68,13 +68,13 @@ cleanup() {
 	done
 }
 
-ctrl-c() {
+ctrl_c() {
 	exitonerror=1
 }
 
 do_setup() {
   trap cleanup 0 1 3 15
-  trap ctrl-c 2
+  trap ctrl_c 2
 
   devlist=
   for d in 0 1 2 3 4 5 6 7 8 9 10 11 12
-- 
1.7.2.5


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

* Re: [PATCH] Fix recommended test command
  2012-11-17 12:37 [PATCH] Fix recommended test command Gilles Espinasse
@ 2012-11-18 23:03 ` NeilBrown
  0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2012-11-18 23:03 UTC (permalink / raw)
  To: Gilles Espinasse; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 1634 bytes --]

On Sat, 17 Nov 2012 13:37:53 +0100 Gilles Espinasse <g.esp@free.fr> wrote:

> Signed-off-by: Gilles Espinasse <g.esp@free.fr>
> 
> Recommended 'sh ./test' fail with
> LANG=C sudo sh ./test
> ./test: line 73: `ctrl-c': not a valid identifier
> 
> Replace '-' by '_' in the ctrl-c function name fix that.

Thanks.  I already have fixed that .. but I haven't pushed it out yet.  I
should  do that - later today.


> In the same time, update the recommended command to 'bash ./test' to match the shebang

Maybe should just make it:
   ./test

as it has "#!/bin/bash" at the top.  I might fix that too.

Thanks,
NeilBrown


> ---
>  Makefile |    2 +-
>  test     |    4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index d99ea2b..94229fa 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -268,7 +268,7 @@ uninstall:
>  	rm -f $(DESTDIR)$(MAN8DIR)/mdadm.8 $(DESTDIR)$(MAN8DIR)/mdmon.8 $(DESTDIR)$(MAN4DIR)/md.4 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 $(DESTDIR)$(BINDIR)/mdadm
>  
>  test: mdadm mdmon test_stripe swap_super
> -	@echo "Please run 'sh ./test' as root"
> +	@echo "Please run 'bash ./test' as root"
>  
>  clean : 
>  	rm -f mdadm mdmon $(OBJS) $(MON_OBJS) $(STATICOBJS) core *.man \
> diff --git a/test b/test
> index 3f8515f..a3c2a24 100755
> --- a/test
> +++ b/test
> @@ -68,13 +68,13 @@ cleanup() {
>  	done
>  }
>  
> -ctrl-c() {
> +ctrl_c() {
>  	exitonerror=1
>  }
>  
>  do_setup() {
>    trap cleanup 0 1 3 15
> -  trap ctrl-c 2
> +  trap ctrl_c 2
>  
>    devlist=
>    for d in 0 1 2 3 4 5 6 7 8 9 10 11 12


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

end of thread, other threads:[~2012-11-18 23:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-17 12:37 [PATCH] Fix recommended test command Gilles Espinasse
2012-11-18 23:03 ` NeilBrown

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.