Solved

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

Posted on 2004-09-14
3
264 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CPU monthly average? 12 120
Help stop mail server from sending spam. 27 125
Remote Change Dates on AIX Automation 7 62
How to Insert a File Using Text Editor 9 89
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
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…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

773 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