up vote 0 down vote favorite
share [g+] share [fb]

I want to replace the string

/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.3.99/lib/cucumber.rb

with the string

/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.3.99/lib/

on the command line, probably using sed. I can't for the life of me figure out the replacement regex to pass to sed. Or maybe sed isn't even the right tool for the job. Any help would be appreciated.

link|improve this question
feedback

1 Answer

up vote 8 down vote accepted

no need for sed:

dirname /usr/local/bin/program

will return /usr/local/bin

link|improve this answer
Thanks Marcin, I knew this must have been simpler! – Alex Kahn Sep 29 '09 at 17:19
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.