Solved

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

Posted on 2004-09-14
3
281 Views
Last Modified: 2010-04-21
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
Comment
Question by:jimdgar
  • 2
3 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 12060426
What you are describing is shell globbing, ie:  the shell is expanding any of the patterns *before* it is parsed to the program.
0
 

Author Comment

by:jimdgar
ID: 12060657
I understand.  The question is whether the function which does the expansion can be called separately.
0
 
LVL 48

Accepted Solution

by:
Tintin earned 50 total points
ID: 12060856
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
NTP Server in VMware 5 381
centos commands 6 89
capture vmstat info and insert it into an oracle table 31 57
Equivalent of WSUS for Solaris, AIX and Cisco devices 11 65
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question