#ruby-lang - Sat 12 May 2007 between 00:00 and 00:12

NY Lost Funds



LoganCapaldodef sdb1(s); "sdb1"; end
rubyrocksThanks for the help! I will check the tutorial, might be back later with questions. Cya!
LoganCapaldosdb1(" 8 17 78150712 sdb1\n") #=> "sdb1"
motionhahaha
logancapaldo: that looks like a useful method
OtherSideLoganCapaldo---thanks, that looks like what I need...
I'll try that...
actionLoganCapaldo bashes head against the wall
LoganCapaldobashes head against the wall
ipaddictumm...
jptixlol
ipaddictwow.
LoganCapaldoOtherSide: you're not getting it
my method doesn't do anything
You know you need the string "sdb1"
So just use the string "sdb1"
OtherSidethis is what i did--- Dir.chdir("/proc') f = File.open("partitions") fgrep = f.grep(/sd.[0-9]/) fgrep # returns " 8 17 78150712 sdb1\n" and I just need 'sdb1' to pass off to another part of the script
LoganCapaldoaha
and the truth comes out
jptix:)
OtherSide:)
ipaddictlike pulling teeth
LoganCapaldostr[/sd.[0-9]/]
OtherSideso fgrep[/sd.[0-9]/] = part or something like that?
jptixyeah, fgrep[/sd.[0-9]/] => "sdb1" in your example
OtherSideok...cool
LoganCapaldowell fgrep is gonna be an array actually
OtherSideyeah...its already an array with one entry
jptixfgrep[0][/sd.[0-9]/] => "sdb1"
LoganCapaldoso you'll want fgrep.map { |s| s[/sdb.[0-9]/] } or fgrep.first[/sd.[0-9]/]
OtherSidethats why i was having problems...i was going to try and slice...but i cant because there is only one entry
LoganCapaldo --- thanks...I'll have to look up the .map method
i appreaciate the help...gotta attend to my kids... :) cya
ipaddictOtherSide: map is definitely a need-to-know
OtherSideI'm pretty new to ruby...I actually just started with it about 3 days ago...
so i will look up that method in the manual
ipaddictruby-doc.org
OtherSidei'm not really a programmer either...but learning :)
thanks everyone...
jastthat's closer to being a programmer than most people are
OtherSidejast--thanks...

Page: 2 9 16 23 30 37 44 

IrcArchive

NY Lost Funds