Greg Ercolano wrote:
Andrew Kingston wrote:
I found what was causing the problem. There was a piece of code which
a colleague had added (I thought it was from the original example
script), which used unix commands (mv, awk, etc which were in the
system path because cygwin is installed on all our windows machines).
These were then executed using system() in the section around where
the script creates defaults, or loads previous settings in to the gui
- that's why it worked OK sometimes & not others. If you run the
Cygwin awk from a DOS command prompt, you should see something akin to
the error I was getting.
Really?
Sounds like it might be a 16 bit version of Cygwin, or a 16 bit
version of perl.
Perl's system() and DOS (cmd.exe) should be able to invoke 32 bit
versions
of Cygwin (such as mv, awk, etc) just fine..
I think the problem is deeper; either a 16 bit version of Perl, DOS,
or Cygwin is involved here..
Sorry - I should have said. I've taken the code which is causing the
problem out of the script, as it's not needed any more, so my script is
working fine now.
It is strange though. I've found so far it's just the awk command that
causes the problem...
I've just been doing a bit more digging & I think I've found what was
causing the problem. In \cygwin\bin if you do an ls -l awk.exe, it
gives you: lrwxrwxrwx 1 Adminst Users 19 Nov 1 2004 awk.exe -> gawk.exe.
If I run gawk.exe at a DOS prompt I don't get any errors, but run
awk.exe, and I get the error I've been mentioning. I get the same error
whenever I try to run one of the linked Cygwin apps at a DOS prompt -
like gunzip.exe & zcat.exe. So it looks like I could put the code back
into my script if I needed to as long as I used gawk instead of awk.
Cheers
Andrew
|