The following command works fine in my cshell script:
set Deliverables = `find . -name "[Dd]eliverables" -print`
The following command does not work:
set LASFiles = `find . -name "*.[Ll][Aa][Ss]" -print`
In the first example, when tested in an if statement, the script will continue whether a folder or file called Deliverables (or deliverables) exists or not.
In the second example the script will post the error "No Match" and hang if no .las (or .LAS) files are present. Apparently there is something that the Cshell does not like about my wildcard. Does anyone know the trick here?
Thanks
Am I correct in my conclusion that there is no way in Cshell to find out whether or not files with a particular suffix (ie *.xyz) exist without having anything echoed back to the screen?
Thanks,
Paul H.
In my relentless pursuit of programming perfection, and in answer to my question above, I have discovered that the following code does what I am trying to do in the Cshell:
set pds_files = `find . -name "*.[Pp][Dd][Ss]" -print`
if ("$pds_files" != "") then
...
else
...
endif
This works regardless of the presence or absence of any .pds (or .PDS) files. It does seem, however, that I had tried this code previously in my many various permutations of it. One thing I did differently this time, however, was add empty lines separating parts of my code. Is there any conceivable way that adding empty lines can have such an effect?
While I can appreciate that the Cshell is not the best environment for programming, the thought of converting everything over to the Bourne shell makes me go queasy. I appreciate the input re: various sources of help with cshell programming.
Thanks,
Paul H.