Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I match a forward slash in bbe?

If I have this text file called test.txt:

foo / bar

I can match it in sed like so:

sed -e 's/foo \/ bar/it worked!/' test.txt

However when doing the same thing in bbe it doesn't replace it:

bbe -e 's/foo \/ bar/it worked!/' test.txt

I have also tried double escaping and triple escaping the slash, however it doesn't seem to work anyway.

What am I doing wrong?

share|improve this question
up vote 3 down vote accepted

Not sure how to escape the /, but some alternate solutions:

  • Using a hex escape sequence: 's/foo \x2F bar/it worked!/'
  • Using a different delimiter such as underscore: 's_foo / bar_it worked!_'
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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