Greetings,
does anybody know about some command to convert shell globs (shell pat- >terns) into regular expressions? Back in the old Unix days there was a >"glob" command, but "e-files" only turns up a GNU library.
I am aware of Python's "fnmatch.translate()" function, but this -- of >course -- returns a Python style regular expression which I can't use >together with "grep" or "gawk". So using this function would require >moving and converting the "grep" and "gawk" specific code from my Shell >script into a separate Python script. This would be doable, if neces- >sary, but I would prefer staying with just my Shell script.
Any pointers heartily welcome :-)
Sincerely,
Rainer
Greetings,
does anybody know about some command to convert shell globs (shell pat- terns) into regular expressions?
Greetings,
does anybody know about some command to convert shell globs (shell pat- terns) into regular expressions? Back in the old Unix days there was a "glob" command, but "e-files" only turns up a GNU library.
I am aware of Python's "fnmatch.translate()" function, but this -- of course -- returns a Python style regular expression which I can't use together with "grep" or "gawk". So using this function would require moving and converting the "grep" and "gawk" specific code from my Shell script into a separate Python script. This would be doable, if neces- sary, but I would prefer staying with just my Shell script.
Any pointers heartily welcome :-)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 303 |
Nodes: | 16 (2 / 14) |
Uptime: | 84:13:02 |
Calls: | 6,808 |
Calls today: | 4 |
Files: | 12,328 |
Messages: | 5,401,327 |