Rebhan, Gilbert
2/19/2007 1:14:00 PM
Hi,
did it with =
newfiles=Array.new
Dir.chdir(CVSWORKSPACE)
pipe=IO.popen(".../cvs.exe -d
:pserver:#{ENV["USERNAME"]}@cvsprod:d:/cvsrepos/test update")
p pipe.readlines.each { |x|
newfiles<<'.'<<'/'<<x[2..-2]<<' ' }
puts newfiles.to_s
> ./subfolder1/file4.txt ./subfolder1/file5.txt
Recommended or is there a better way ?
-----Original Message-----
From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de]
Sent: Monday, February 19, 2007 2:01 PM
To: ruby-talk ML
Subject: Re: system(...) redirect output to file ?
Hi,
-----Original Message-----
From: Kalman Noel [mailto:invalid@gmx.net]
Sent: Monday, February 19, 2007 11:45 AM
To: ruby-talk ML
Subject: Re: system(...) redirect output to file ?
/*
output = `command here`
Note the use of backticks (`), and note that only the command's stdout
is
redirected. For more complicated use there is IO.popen.
*/
until now i redirected the output from cvs update command to a file,
format looks like =
? subfolder1/file4.txt
? subfolder1/file5.txt
and parsed it with =
open($deployserver<<'/cvsout.txt').each { |x|
newfiles<<'.'<<'/'<<x[2..-3]<<' ' }
to get all newfiles in a space separated string for the following
cvs add command
How to do that with the ` backquote method or IO.popen ?
f.e.
Dir.chdir(CVSWORKSPACE)
pipe=IO.popen(".../cvsnt/cvs.exe -d
:pserver:#{ENV["USERNAME"]}@cvsprod:d:/cvsrepos/test update")
??? how do i get the pipe contents into a space separated string ???
Regards, Gilbert