The problem I have now, is that I don't know how to 'scan' the argument list stored in argv. Ideally, I want the program to be run
uprompt> ./htx2 *.html > index.html
So this means whatever the extension is , say *.c *.h, the script will find it in argv, and place it in var, so var = `ls *.html` say. Then only files with the html extension will be listed in the html file.
How can I do this. I've tried and cannot seem to get it. The users input, *.html, or *.c or whatever (including multiple wildcards), can occur anywhere in the argv line. So it could follow other switches, whatever. How can I scan the line, and pass the search term to ls?