Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Is it possible to pass a filename without knowing it's full name?
I want to write some generic code that will call a script with two filenames, from within a wrapper file.
i.e script_1.ksh <filename> <filename>
The filenames will have a standard format
system name, padding, date, padding and run id.The run id will be passed into the wrapper file as a parameter, so the filenames will look something like this;
OUTPUTxxx091003xxOOO1.DAT.
I am uninterested in the date component, as the run id will always be unique
I want to automate the process as much as possible, requiring that the user need only enter the wrapper script name and a run id to perform some verification.
Any thoughts much appreciated.

If you specify a wildcard when calling the script, then the shell will expand it first (if it can) and the called script will only see the expanded list. Alternatively the script could determine the set of matching filenames itself according to some rules.
It could be worth reading up on shell wildcards as you can build some quite detailed expressions, e.g. in ksh
test+([1-3]).???
matches test1.dat but not test1.html, test2.dat or test.doc.

![]() |
Unix or perl script
|
AIX 4.3.3 to AIX 5.2
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |