Cperf problem creating C function for Perform screen
Posted in 2005
Topics: General Discussion
When I try to compile any C function using cperf (even the example in the examples directory, which is the same as the one in the Informix SQL Reference manual), I get the following message: cperf[68]: syntax error at line 115 : `"' unmatched Nothing I've tried to compile even has 115 lines. Does anyone have any idea what the problem is? Thanks!
Jo wrote: > When I try to compile any C function using cperf (even the example in > the examples directory, which is the same as the one in the Informix > SQL Reference manual), I get the following message: > > cperf[68]: syntax error at line 115 : `"' unmatched > > Nothing I've tried to compile even has 115 lines. > > Does anyone have any idea what the problem is? It looks like there's an unmatched quote in the shell script called cperf -- somewhere around line 115, perhaps. Unless you are using C Shell or a derivative as your login shell, it is most likely a bug. To eliminate the possibility that your shell is part of the problem, try using: sh $INFORMIXDIR/bin/cperf [...the other options as before...] If that works, then you've probably got a C Shell that doesn't notice that the first character of the script is a colon - that used to be sufficient to ensure that the C Shell ran a real shell. If that doesn't work either, or you've already understood 'C Shell Programming Considered Harmful' (Google it), then it is a bug. If that does make it work, it's time you read the article referenced above (along with "'Considered Harmful' Considered Harmful" -- Google that, too). [And report the bug to IBM - because it still is a bug, just not quite such a serious one since there's a simple workaround.] If the 'sh' trick does work, make a backup copy of cperf, then edit it so the first line reads: #!/bin/sh Simply insert that before the rest of the script - it is the major part of the longer term bug fix too. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/
I wrote: > When I try to compile any C function using cperf (even the example in > the examples directory, which is the same as the one in the Informix > SQL Reference manual), I get the following message: > > cperf[68]: syntax error at line 115 : `"' unmatched Jonathan Leffler kindly responded: > It looks like there's an unmatched quote in the shell script called > cperf -- somewhere around line 115, perhaps. > > Unless you are using C Shell or a derivative as your login shell, it is > most likely a bug. To eliminate the possibility that your shell is part > of the problem, try using: > > sh $INFORMIXDIR/bin/cperf [...the other options as before...] > > If that works, then you've probably got a C Shell that doesn't notice > that the first character of the script is a colon - that used to be > sufficient to ensure that the C Shell ran a real shell. Me again: I was using ksh, but even using sh didn't completely resolve the problem. Instead, I got the message "Unexpected end of file". I finally found that line 91 was missing its closing double-quote. Thanks for the help. jo