Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #388301

Re: Command line globber/tokenizer library for C?

From Ben Bacarisse <ben@bsb.me.uk>
Newsgroups comp.lang.c
Subject Re: Command line globber/tokenizer library for C?
Date 2024-09-12 10:43 +0100
Organization A noiseless patient Spider
Message-ID <87o74ti4vb.fsf@bsb.me.uk> (permalink)
References <lkbjchFebk9U1@mid.individual.net> <vbsmlb$3o6n2$1@raubtier-asyl.eternal-september.org> <lke71fFqdjcU1@mid.individual.net> <87cyl9zx14.fsf@nosuchdomain.example.com> <lkf456Fuf84U1@mid.individual.net>

Show all headers | View raw


ted@loft.tnolan.com (Ted Nolan <tednolan>) writes:

> In article <87cyl9zx14.fsf@nosuchdomain.example.com>,
> Keith Thompson  <Keith.S.Thompson+u@gmail.com> wrote:
>>ted@loft.tnolan.com (Ted Nolan <tednolan>) writes:
>>> In article <vbsmlb$3o6n2$1@raubtier-asyl.eternal-september.org>,
>>> Bonita Montero  <Bonita.Montero@gmail.com> wrote:
>>>>Am 11.09.2024 um 16:59 schrieb Kenny McCormack:
>>>>> In article <vbs1om$3jkch$1@raubtier-asyl.eternal-september.org>,
>>>>> Bonita Montero  <Bonita.Montero@gmail.com> wrote:
>>>>>> Do you think it would make sense to switch the language ?
>>>>
>>>>> Do you think it would make sense to pay attention to the "Newsgroups" line
>>>>> in your header before clicking "Send"?
>>>>
>>>>I just wanted to suggest a simpler language.
>>>>Compare that with a manual implementation of the same in C.
>>>
>>> Thanks, I appreciate that, but it does have to be C.
>>
>>We could help you more effectively if we understood your requirements.
>>
>>Why exactly does it have to be C?
>>
>>What system or systems do you need to support?  (I asked this before and
>>you didn't answer.)
>>
>>If you only care about Windows, for example, that's going to affect what
>>solutions we can offer; likewise if you only care about POSIX-based
>>systems, or only about Linux-based systems.
>>
>>It might also be useful to know more about the context.  If this is for
>>some specific application, what is that application intended to do, and
>>why does it need to do tokenization and globbing?
>>
>
> This would be for work, so I am limited in what I can say about it, but
> it has to be in C because it is would be a C callout from a GT.M mumps
> process.  GT.M stores the command line tail (everything it doesn't need
> to get a program running) in the special variable $ZCMDLINE which can
> be passed to a callout.  I would like to parse that string as the
> shell does a command line.  Basically, if it isn't a C library that
> is commonly available through Linux package managers I probably can't
> use it.  In the end this is a "nice to have" and I have a q&d approach
> that I will probably use.

If it were down to me I'd do the word splitting "by hand" and use POSIX
glob(3) to do the file expansion.

For the word splitting, the key would be to know where these strings
come from and what is really needed.  That would enable you to pick a
syntax that makes sense for your particular use-case.  For example, if
the string are typed by people, I wouldn't use the typical shell
quoting.  I would not want anyone (other than technical Unix users) to
have to type

  'He said "you can'"'""t"

You might get away with a very simple word splitting algorithm.

-- 
Ben.

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Command line globber/tokenizer library for C? ted@loft.tnolan.com (Ted Nolan <tednolan>) - 2024-09-10 19:01 +0000
  Re: Command line globber/tokenizer library for C? Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-10 20:58 +0000
    Re: Command line globber/tokenizer library for C? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-09-10 14:12 -0700
  Re: Command line globber/tokenizer library for C? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-09-10 23:05 +0200
    Re: Command line globber/tokenizer library for C? ted@loft.tnolan.com (Ted Nolan <tednolan>) - 2024-09-10 22:11 +0000
  Re: Command line globber/tokenizer library for C? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-09-10 14:37 -0700
    Re: Command line globber/tokenizer library for C? ted@loft.tnolan.com (Ted Nolan <tednolan>) - 2024-09-10 22:13 +0000
  Re: Command line globber/tokenizer library for C? gazelle@shell.xmission.com (Kenny McCormack) - 2024-09-11 01:56 +0000
    Re: Command line globber/tokenizer library for C? ted@loft.tnolan.com (Ted Nolan <tednolan>) - 2024-09-11 02:54 +0000
  Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-11 14:17 +0200
    Re: Command line globber/tokenizer library for C? ted@loft.tnolan.com (Ted Nolan <tednolan>) - 2024-09-11 12:22 +0000
      Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-11 14:28 +0200
        Re: Command line globber/tokenizer library for C? ted@loft.tnolan.com (Ted Nolan <tednolan>) - 2024-09-11 12:44 +0000
    Re: Command line globber/tokenizer library for C? Bart <bc@freeuk.com> - 2024-09-11 13:42 +0100
    Re: Command line globber/tokenizer library for C? gazelle@shell.xmission.com (Kenny McCormack) - 2024-09-11 14:59 +0000
      Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-11 20:14 +0200
        Re: Command line globber/tokenizer library for C? gazelle@shell.xmission.com (Kenny McCormack) - 2024-09-11 18:17 +0000
        Re: Command line globber/tokenizer library for C? ted@loft.tnolan.com (Ted Nolan <tednolan>) - 2024-09-11 18:49 +0000
          Re: Command line globber/tokenizer library for C? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-09-11 14:43 -0700
            Re: Command line globber/tokenizer library for C? ted@loft.tnolan.com (Ted Nolan <tednolan>) - 2024-09-12 03:06 +0000
              Re: Command line globber/tokenizer library for C? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-09-11 20:37 -0700
                Re: Command line globber/tokenizer library for C? ted@loft.tnolan.com (Ted Nolan <tednolan>) - 2024-09-12 03:56 +0000
                Re: Command line globber/tokenizer library for C? gazelle@shell.xmission.com (Kenny McCormack) - 2024-09-12 13:22 +0000
                Re: Command line globber/tokenizer library for C? ted@loft.tnolan.com (Ted Nolan <tednolan>) - 2024-09-12 13:50 +0000
                Columbia (Was: Command line globber/tokenizer library for C?) gazelle@shell.xmission.com (Kenny McCormack) - 2024-09-12 14:06 +0000
                Re: Columbia (Was: Command line globber/tokenizer library for C?) Michael S <already5chosen@yahoo.com> - 2024-09-12 17:20 +0300
                Re: Columbia (Was: Command line globber/tokenizer library for C?) David Brown <david.brown@hesbynett.no> - 2024-09-12 16:43 +0200
                Re: Columbia (Was: Command line globber/tokenizer library for C?) Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-12 22:07 +0000
              Re: Command line globber/tokenizer library for C? Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-12 04:14 +0000
              Re: Command line globber/tokenizer library for C? Ben Bacarisse <ben@bsb.me.uk> - 2024-09-12 10:43 +0100
        Re: Command line globber/tokenizer library for C? Bart <bc@freeuk.com> - 2024-09-11 21:19 +0100
          Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-12 04:22 +0200
            Re: Command line globber/tokenizer library for C? Bart <bc@freeuk.com> - 2024-09-12 12:29 +0100
              Re: Command line globber/tokenizer library for C? gazelle@shell.xmission.com (Kenny McCormack) - 2024-09-12 12:13 +0000
                Re: Command line globber/tokenizer library for C? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-09-12 14:24 +0200
                Other programming languages (Was: Command line globber/tokenizer library for C?) gazelle@shell.xmission.com (Kenny McCormack) - 2024-09-12 13:20 +0000
                Re: Other programming languages (Was: Command line globber/tokenizer library for C?) Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-12 16:01 +0200
                Re: Other programming languages (Was: Command line globber/tokenizer library for C?) gazelle@shell.xmission.com (Kenny McCormack) - 2024-09-12 14:07 +0000
                Re: Other programming languages (Was: Command line globber/tokenizer library for C?) Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-12 16:14 +0200
                Re: Other programming languages (Was: Command line globber/tokenizer library for C?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-09-12 17:40 +0200
                Re: Other programming languages (Was: Command line globber/tokenizer library for C?) Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-12 17:48 +0200
                Re: Other programming languages (Was: Command line globber/tokenizer library for C?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-09-12 17:59 +0200
                Re: Other programming languages (Was: Command line globber/tokenizer library for C?) Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-12 22:32 +0000
                Re: Other programming languages (Was: Command line globber/tokenizer library for C?) James Kuyper <jameskuyper@alumni.caltech.edu> - 2024-09-12 18:50 -0400
                Re: Other programming languages (Was: Command line globber/tokenizer library for C?) Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-13 01:37 +0000
                Re: Other programming languages (Was: Command line globber/tokenizer library for C?) Michael S <already5chosen@yahoo.com> - 2024-09-13 11:30 +0300
                Re: Other programming languages (Was: Command line globber/tokenizer library for C?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-09-13 04:06 +0200
                Re: Other programming languages (Was: Command line globber/tokenizer library for C?) Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-13 02:58 +0000
                Re: Other programming languages (Was: Command line globber/tokenizer library for C?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-09-13 14:31 +0200
                Re: Other programming languages (Was: Command line globber/tokenizer library for C?) Kaz Kylheku <643-408-1753@kylheku.com> - 2024-09-13 04:18 +0000
                Re: Other programming languages (Was: Command line globber/tokenizer library for C?) Kaz Kylheku <643-408-1753@kylheku.com> - 2024-09-13 03:38 +0000
                Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-12 16:00 +0200
              Re: Command line globber/tokenizer library for C? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-09-12 14:20 +0200
                Re: Command line globber/tokenizer library for C? Bart <bc@freeuk.com> - 2024-09-12 14:44 +0100
                Re: Command line globber/tokenizer library for C? Bart <bc@freeuk.com> - 2024-09-12 15:16 +0100
                Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-12 16:23 +0200
                Re: Command line globber/tokenizer library for C? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-09-12 17:46 +0200
                Re: Command line globber/tokenizer library for C? Bart <bc@freeuk.com> - 2024-09-12 17:15 +0100
                Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-12 18:26 +0200
                Re: Command line globber/tokenizer library for C? Michael S <already5chosen@yahoo.com> - 2024-09-12 18:16 +0300
                Re: Command line globber/tokenizer library for C? scott@slp53.sl.home (Scott Lurndal) - 2024-09-12 15:37 +0000
                Re: Command line globber/tokenizer library for C? Michael S <already5chosen@yahoo.com> - 2024-09-12 18:49 +0300
                Re: Command line globber/tokenizer library for C? Bart <bc@freeuk.com> - 2024-09-12 17:28 +0100
                Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-12 19:02 +0200
                Re: Command line globber/tokenizer library for C? gazelle@shell.xmission.com (Kenny McCormack) - 2024-09-12 17:39 +0000
                Re: Command line globber/tokenizer library for C? Michael S <already5chosen@yahoo.com> - 2024-09-12 22:38 +0300
                Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-13 07:28 +0200
                Re: Command line globber/tokenizer library for C? Michael S <already5chosen@yahoo.com> - 2024-09-13 11:38 +0300
                Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-13 14:12 +0200
                Re: Command line globber/tokenizer library for C? Michael S <already5chosen@yahoo.com> - 2024-09-13 15:25 +0300
                Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-13 15:20 +0200
                Re: Command line globber/tokenizer library for C? Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-13 22:24 +0000
                Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-14 01:42 +0200
                Re: Command line globber/tokenizer library for C? Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-14 01:41 +0000
                Re: Command line globber/tokenizer library for C? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-09-13 09:05 -0700
                Re: Command line globber/tokenizer library for C? Michael S <already5chosen@yahoo.com> - 2024-09-15 12:22 +0300
                Re: Command line globber/tokenizer library for C? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-09-16 00:52 -0700
                Re: Command line globber/tokenizer library for C? Michael S <already5chosen@yahoo.com> - 2024-09-16 12:23 +0300
                Re: Command line globber/tokenizer library for C? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-09-17 03:12 -0700
                Re: Command line globber/tokenizer library for C? antispam@fricas.org - 2024-09-17 22:34 +0000
                Re: Command line globber/tokenizer library for C? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-09-17 16:33 -0700
                Re: Command line globber/tokenizer library for C? Michael S <already5chosen@yahoo.com> - 2024-09-18 02:46 +0300
                Re: Command line globber/tokenizer library for C? Bart <bc@freeuk.com> - 2024-09-18 01:07 +0100
                Re: Command line globber/tokenizer library for C? Michael S <already5chosen@yahoo.com> - 2024-09-18 11:43 +0300
                Re: Command line globber/tokenizer library for C? Bart <bc@freeuk.com> - 2024-09-18 10:49 +0100
                Re: Command line globber/tokenizer library for C? David Brown <david.brown@hesbynett.no> - 2024-09-18 12:44 +0200
                Re: Command line globber/tokenizer library for C? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-09-18 06:01 -0700
                Re: Command line globber/tokenizer library for C? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-09-17 18:31 -0700
                Re: Command line globber/tokenizer library for C? Michael S <already5chosen@yahoo.com> - 2024-09-18 11:03 +0300
                Re: Command line globber/tokenizer library for C? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-09-18 05:09 -0700
                Re: Command line globber/tokenizer library for C? Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-18 02:20 +0000
                Re: Command line globber/tokenizer library for C? Michael S <already5chosen@yahoo.com> - 2024-09-18 11:05 +0300
                Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-12 16:04 +0200
                Re: Command line globber/tokenizer library for C? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-09-12 17:30 +0200
                Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-12 17:47 +0200
                Re: Command line globber/tokenizer library for C? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-09-12 17:56 +0200
                Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-12 18:09 +0200
                Re: Command line globber/tokenizer library for C? Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-13 02:43 +0000
                Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-13 07:27 +0200
                Re: Command line globber/tokenizer library for C? Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-13 06:49 +0000
                Re: Command line globber/tokenizer library for C? Michael S <already5chosen@yahoo.com> - 2024-09-13 11:49 +0300
                Re: Command line globber/tokenizer library for C? Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-13 22:04 +0000
                Re: Command line globber/tokenizer library for C? Bart <bc@freeuk.com> - 2024-09-13 23:48 +0100
                Re: Command line globber/tokenizer library for C? Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-14 01:41 +0000
                Re: Command line globber/tokenizer library for C? Bart <bc@freeuk.com> - 2024-09-14 10:58 +0100
                Re: Command line globber/tokenizer library for C? Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-14 22:37 +0000
              Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-12 15:58 +0200
  Re: Command line globber/tokenizer library for C? Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-12 17:08 +0200
    More OT BS (Was: Command line globber/tokenizer library for C?) gazelle@shell.xmission.com (Kenny McCormack) - 2024-09-12 15:23 +0000
      Re: More OT BS (Was: Command line globber/tokenizer library for C?) Bonita Montero <Bonita.Montero@gmail.com> - 2024-09-12 17:24 +0200
    Re: Command line globber/tokenizer library for C? Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-12 22:09 +0000

csiph-web