From: Jan Svitok Date: 2007-03-13T08:52:11+09:00 Subject: Re: perl to ruby On 3/13/07, Marcin Kulisz wrote:> hi all,> today is my first day with ruby and I'm trying to rewrite a few of my> scripts from perl to ruby & it's not too easy. can anyone help me with> script below. I've done a few thinks but when one is working another> don't. #!/usr/bin/ruby -w usr = ARGV[0]id = `cat /etc/passwd|grep #{usr}|cut -d\":\" -f3`.to_iif id>=1000 text=`finger #{usr}` text.gsub!(/\n/, "
") puts textelse puts "wal si� na ryj z�odzieju"end alternatively you can do: text=`finger #{usr}`.gsub(/\n/, "
")instead of those two lines. puts appends \n, if you don't like it, use print