All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: kai@germaschewski.name, sam@ravnborg.org
Cc: lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [TRIVIAL] avoid "expr length" (improved version)
Date: Tue, 23 Mar 2004 10:53:43 +1100	[thread overview]
Message-ID: <1079999622.6601.114.camel@bach> (raw)

 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)


                 reply	other threads:[~2004-03-22 23:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1079999622.6601.114.camel@bach \
    --to=rusty@rustcorp.com.au \
    --cc=kai@germaschewski.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.