🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #44

shell pattern matching...

#44
From: Siva Nadarajah
Date: Tue, 03 Nov 1992 15:33
20 lines
1298 bytes
I am developing an application on SunOS 4.1.1 and HPUX 8.0.
This requires filenames to be matched for a given pattern 
as shell does. I understand that the way shell matches filenames 
for a given pattern is quite different from the way regular 
expressions routines (re_comp() and re_exec()) does.

In my application I tried to preprocess the given pattern and
feed it to the regex routines (for example replacing a "." in
the given pattern to "[.]" and a "?" to "." etc.). Unfortunately,
this does not work quite right as far as the wildcard goes.

Can anyone suggest any pointers to routines (public domain...)
which will match patterns exactly the same way the shell does.


Your help is very much appreciated.


Siva.
Technical Details
Message-ID: <1992Nov3.153318.4918@kocrsv01.delcoelect.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!news.centerline.com!noc.near.net!hri.com!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!sun-barr!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!rphroy!kocrsv01!c23sn

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!news.centerline.com!noc.near.net!hri.com!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!sun-barr!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!rphroy!kocrsv01!c23sn
From: c23sn@kocrsv01.delcoelect.com (Siva Nadarajah)
Newsgroups: comp.unix.programmer
Subject: shell pattern matching...
Message-ID: <1992Nov3.153318.4918@kocrsv01.delcoelect.com>
Date: 3 Nov 92 15:33:18 GMT
Sender: news@kocrsv01.delcoelect.com (Usenet News Account)
Organization: Delco Electronics Corp.
Lines: 20
Originator: c23sn@kocrsw08