Take the 2-minute tour ×
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.

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
add comment

1 Answer

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
add comment

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.