Liste des Groupes | Revenir à cl c |
On 10.09.2024 21:01, Ted Nolan <tednolan> wrote:I have the case where my C program is handed a string which is basically>
a command line.
IIUC you don't want the shell to do the expansion but, sort of,
re-invent the wheel in your application (a'la DOS). - Okay.
>>
Is there a common open source C library for tokenizing and globbing
this into an argc/argv as a shell would do? I've googled, but I get
too much C++ & other language stuff.
I also suppose that by "tokenizing" you don't mean something like
strtok (3) - extract tokens from strings
but a field separation as the Unix shell does using 'IFS'.
>
I don't know of a C library but if I'd want to implement a function
that all POSIX shells do then I'd look into the shell packages...
>
For Kornshell (e.g. version 93u+m) I see these files in the package
src/lib/libast/include/glob.h
src/lib/libast/misc/glob.c
that obviously care about the globbing function. (I suspect you'll
need some more supporting files from the ksh package.)
>
HTH
>
Janis
>
Les messages affichés proviennent d'usenet.