tabbendectomy, pty on OpenBSD 
Author Message
 tabbendectomy, pty on OpenBSD

% cat spawn-cat.rb
#!/usr/bin/env ruby

require 'pty'

["The trees are bending over", "The cows are lying down"].each {|string|
  PTY.spawn("cat -") do |r,w|
   tabit = string.gsub(/ +/, "\t")
   w.puts tabit
   foo =  r.gets.gsub(/\r\n/,"")
   puts "tabbendectomy" unless foo == tabit
  end

Quote:
}

On OpenBSD (2.9) this prints:
% ./spawn-cat.rb
tabbendectomy
tabbendectomy
% ruby -v
ruby 1.6.5 (2001-09-19) [i386-openbsd2.9]

On Linux (redhat 7.1) , it is ok (prints nothing).
On Solaris (7) it just hangs.
I couldn't build ruby 1.6.5 on AIX (4.3) w/gcc

% make
...
compiling digest/rmd160
make[1]: Entering directory `/home/pete/tmp/ruby-1.6.5/ext/digest/rmd160'
/usr/ccs/bin/ld  -brtl -eInit_rmd160 -bI:/home/pete/tmp/ruby-1.6.5/ruby.imp \
-bM:SRE -T512 -H512 -lc -L/home/pete/tmp/ruby-1.6.5  -o rmd160.so rmd160.o \
rmd160hl.o rmd160init.o  -lc
ld: 0711-317 ERROR: Undefined symbol: .__eprintf

  Pete
--
screwbean: a shrub or small tree found in the US Desert Southwest



Wed, 21 Apr 2004 01:25:07 GMT  
 tabbendectomy, pty on OpenBSD

P> On Solaris (7) it just hangs.

 For Solaris try to add

    w.flush

 after `w.puts tabit'

 Try this

   require 'pty'

   ["The trees are bending over", "The cows are lying down"].each {|string|
       PTY.spawn("cat -") do |r,w|
          tabit = string.gsub(/ +/, "\t")
          w.puts tabit
          w.flush
          foo =  r.gets.gsub(/\r\n/,"")
          p tabit, foo
          puts "tabbendectomy" unless foo == tabit
       end
   }

Guy Decoux



Wed, 21 Apr 2004 01:55:27 GMT  
 tabbendectomy, pty on OpenBSD


||
||P> On Solaris (7) it just hangs.
||  
||   ["The trees are bending over", "The cows are lying down"].each {|string|
||       PTY.spawn("cat -") do |r,w|
||          tabit = string.gsub(/ +/, "\t")
||          w.puts tabit
||          w.flush
||          foo =  r.gets.gsub(/\r\n/,"")
||          p tabit, foo
||          puts "tabbendectomy" unless foo == tabit
||       end
||   }

 thanks, no more{*filter*}. Solaris also tabbendectomizes the data.

  Pete
--
screwbean: a shrub or small tree found in the US Desert Southwest



Wed, 21 Apr 2004 03:55:53 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. FXRuby on OpenBSD 3.2

2. Sockets on OpenBSD

3. Porting Ruby Applications to OpenBSD

4. Assembly under OpenBSD/Alpha

5. GNAT for FreeBSD 3.x and OpenBSD/ALPHA 2.4

6. OpenBSD/i386 adress

7. PIL on OpenBSD 3.0

8. dynamically loaded modules (.so files) does not work under openbsd

9. Grail on OpenBSD

10. Install PHP 4.3.1 + IMAP on OpenBSD 3.2

11. Imaging-1.0 Compilation & OpenBSD

12. Problem Compiling Python on OpenBSD.

 

 
Powered by phpBB® Forum Software