I have what may be a trivial problem, but I haven't solved it yet.
I'm using the Korn shell a script on an HP-UX system. I would like
to check for the existence of ANY data files, not a specific file.
I was trying to use the "test" command. This HP-UX does NOT have the
[[...]] operator, even though this was supposedly available after
1986 versions of ksh, :-(
I would like to do:
if test -r *.data
But ksh barks back with a syntax error. test doesn't like wildcards.
I've been trying to get around this, playing with quotes, etc. The
last thing I tried was to assign the list of filenames to a variable,
What I've discovered is that ksh does NOT assign the corresponding
string to filelist. In the csh world you'd get a wordlist. For
instance, in csh, if there were files a.data and b.data,
echo $filelist AND echo "$filelist" both return:
But in ksh, echo $filelist returns:
and echo "$filelist" returns:
The filelist variable never takes on the value of the filenames really.
I was heading this way to possibly try and extract the first filename
from the variable and see if I could use that somehow. But then I
ran into this.
Sorry to be so verbose, but does anyone have the answer that I'm too
blind to see?
Rohm and Haas Co.