Driving me mad. Can't see the error in this code...

E

Edward Wildgoose

I'm trying to track down a problem with my TWiki installation on windows
which is driving me nuts. I have traced it to the rcs command which is run,
but which does nothing via perl, but runs fine from the windows command
prompt.

I have a skeleton piece of code here which demonstrates the problem
use strict;

my $cmd =
'z:/twikiUnixSupportFiles/ci -x,v -q -l -m"none" -t-none -w"edward"
z:/twiki/data/Sandbox/TestTopic4.txt 2>&1';
my $rcsOutput = `$cmd`; # capture stderr (S.Knutson)
print $rcsOutput;
I suspected a shell quoting issue, so I changed the command to be 'echo
z:/twiki/etc etc' and then look at the output variable, but this still
executes fine if I copy and paste it into a windows command prompt...

If I create a deliberate error, eg mis-spell the file name then I do get
back an error from the command (so I am capturing stdout), however, when
running the correct command above I get no output back, but equally no rcs
checkin file is actually created....

Is this a "ci" problem? If so, why might it execute correctly from the cmd
prompt, but not from perl? Am I doing something strange in the code above?

This is all running on Perl 5.8 under Windows 2K

Thanks for any insight, getting bored of looking at this now...

Ed
 
E

Edward Wildgoose

This is just a guess, but is the code example EXACTLY as it is in the
script? Complete with the command on separate lines (same scalar
variable, but on separate lines for readability)?

Nope, sorry, got caught by line wrapping. It was all on one line when I
posted it...

I have worked around it for the time being by using the perl based RCS code
in Twiki, however, it had a silly bug in it which took me a while to track
down (it scrambles the dates accidently if you do two quick edits).

This is very pecualiar, but I can only assume that there is something
strange happening in the way the shell is setup in win32 and the RCS command
is not happy (but failing silently).

Thanks to anyone who looked at it.

Ed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top