Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-09-14
3
Medium Priority
?
294 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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.:
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.
Suggested Courses

604 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