All of lore.kernel.org
 help / color / mirror / Atom feed
* [TRIVIAL] avoid "expr length" (improved version)
@ 2004-03-22 23:53 Rusty Russell
  0 siblings, 0 replies; only message in thread
From: Rusty Russell @ 2004-03-22 23:53 UTC (permalink / raw)
  To: kai, sam; +Cc: lkml - Kernel Mailing List

 From:  Martin Schaffner <maschaffner@gmx.ch>

---
  I improved my patch to avoid the "expr length" GNU-ism. It should be 
  much clearer now. It uses "wc -c" to count the letters.
  
  Thanks,
  Martin
  

--- trivial-2.6.5-rc2-bk2/Makefile.orig	2004-03-23 10:11:35.000000000 +1100
+++ trivial-2.6.5-rc2-bk2/Makefile	2004-03-23 10:11:35.000000000 +1100
@@ -652,7 +652,7 @@
 uts_len := 64
 
 define filechk_version.h
-	if expr length "$(KERNELRELEASE)" \> $(uts_len) >/dev/null ; then \
+	if ((`echo -n "$(KERNELRELEASE)" | wc -c ` > $(uts_len))); then \
 	  echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
 	  exit 1; \
 	fi; \
-- 
  What is this? http://www.kernel.org/pub/linux/kernel/people/rusty/trivial/
  Don't blame me: the Monkey is driving
  File: Martin Schaffner <maschaffner@gmx.ch>: [PATCH] avoid "expr length" (improved version)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-03-22 23:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-22 23:53 [TRIVIAL] avoid "expr length" (improved version) Rusty Russell

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.