Deutsch   English   Français   Italiano  
<87zflrs1ti.fsf@doppelsaurus.mobileactivedefense.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Rainer Weikusat <rweikusat@talktalk.net>
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Command Languages Versus Programming Languages
Date: Fri, 22 Nov 2024 15:52:41 +0000
Lines: 23
Message-ID: <87zflrs1ti.fsf@doppelsaurus.mobileactivedefense.com>
References: <uu54la$3su5b$6@dont-email.me>
	<875xohbxre.fsf@doppelsaurus.mobileactivedefense.com>
	<vhngoi$2p6$1@reader2.panix.com>
	<874j40sk01.fsf@doppelsaurus.mobileactivedefense.com>
	<vhq11q$nq7$1@reader2.panix.com>
	<877c8vtgx6.fsf@doppelsaurus.mobileactivedefense.com>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net RKpHm73RGsdSmv5ebKSNDQUh1YKgCkbw9Ud6bFKo+f8L2VXP8=
Cancel-Lock: sha1:nu23iFHOJs/HQQlVIFQW+yxDvjk= sha1:X+HXhanEoqdfRmFSQ+zjszjqeoI= sha256:OXifvwpxIIJU/o71cuCm6SFHxz4DV5hjUzGwDavMCdc=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Bytes: 1460

Rainer Weikusat <rweikusat@talktalk.net> writes:

[...]


> Something which would match [0-9]+ in its first argument (if any) would
> be:
>
> #include "string.h"
> #include "stdlib.h"
>
> int main(int argc, char **argv)
> {
>     char *p;
>     unsigned c;
>
>     p = argv[1];
>     if (!p) exit(1);
>     while (c = *p, c && c - '0' > 10) ++p;

This needs to be

while (c = *p, c && c - '0' > 9) ++p