#Function to check if the Hardrive is mounted or not
def mount_check(drive_path)
chk_mount=`df -h | grep '#{drive_path}' | wc -l `
return chk_mount
end
problem is :
its taking
c0d1 also c0d11
but if pass variable c0d1
i just want to get line with has c0d1 , not c0d11
Uh, here we go again. What did you try after your last post. You
should be able to do this with only the most basic of Ruby knowledge.
This is what "df -h" gives me...
HI
thanks for the solution
problem is i am not that good in Regix.. and Currently I have very less
time to learn ..
as I am doing some project and trying to finish this quicly so i am
just asking those small bit when i dont know..
may be after i finish the projet.. i will give more time to lear n
the regix i am affer is
/dev/cciss/c0d11p1
/dev/cciss/c0d1p1
c0d1
its end with number
then Charater
p1
also problem is :
i need to provide only c0d1
i cant provide full path
Paste the data above into the "text string" box, then try your regexp in the regexp box. It'll show what it matches live. You can then tweak the regexp until it matches everything you want.
···
On Sep 7, 2012, at 14:34 , Ferdous ara <lists@ruby-forum.com> wrote:
Sorry.. is not it better to give the solution rather then pulling some
else's Leg ???
ok (I dont know grep,Surrender)
would be able to tell me
which Grep parameter will give me output :
only /dev/cciss/c0d1p1 line by providing c0d1 ,(not cod1p1)
From here :
/dev/cciss/c0d1p1
/dev/cciss/c0d10p1
/dev/cciss/c0d11p1
/dev/cciss/c0d12p1
HI
thanks for the solution
problem is i am not that good in Regix.. and Currently I have very less
time to learn ..
as I am doing some project and trying to finish this quicly so i am
just asking those small bit when i dont know..
may be after i finish the projet.. i will give more time to lear n
A friendly suggestion: please learn *now*! That will save you
(and us) a lot of time. This really is most basic stuff, and
if you keep asking these kind of questions you risk that people
eventually won't help you anymore when you are in real trouble.
Paste the data above into the "text string" box, then try your regexp in
the regexp box. It'll show what it matches live. You can then tweak the
regexp until it matches everything you want.
I been to these site before but bit confused about how it works
Under Regular expresson ,i type
c0d1
its give me 3 match ..
but i want only 1 math.. so how that site helping to build regular
expression ??
Thanks for advise.
Writing the regexp is up to you. I'm providing you tools to get faster feedback so you can learn regexps. Also check out my quickref, it has a whole section an what can go into a regexp:
···
On Sep 7, 2012, at 15:05 , Ferdous ara <lists@ruby-forum.com> wrote:
Paste the data above into the "text string" box, then try your regexp in
the regexp box. It'll show what it matches live. You can then tweak the
regexp until it matches everything you want.
I been to these site before but bit confused about how it works
Under Regular expresson ,i type
c0d1
its give me 3 match ..
but i want only 1 math.. so how that site helping to build regular
expression ??