• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

Need a Unix routine to list files by wildcards (*file*)

If I execute under Unix an application (let's say written in C) and pass something like *.pat in on the command line then the argv's I actually see in the C program are already parsed into the individual files.  Is there a stand-alone system command that does this, maybe something I could call from within the C program?
0
jimdgar
Asked:
jimdgar
  • 2
1 Solution
 
TintinCommented:
What you are describing is shell globbing, ie:  the shell is expanding any of the patterns *before* it is parsed to the program.
0
 
jimdgarAuthor Commented:
I understand.  The question is whether the function which does the expansion can be called separately.
0
 
TintinCommented:
man 3 glob
man 3 globfree

Depending on what Unix flavour you have, you may need to adjust the man section.  

Do a

man -k glob

if you have no luck with the above.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now