but I just wondered if there's a sed wizard about who knows how to deal with "// .* not:// .* //" because it might help me tweak some other stuff. I basically want to not more than one char and I think you can only not single chars.

Regards,
ThunorLast edited by thunor on Fri 03 May 2013, 17:45; edited 1 time in total

Thanks seaside but it needs to deal with multiples on the same line which I should've mentioned.

It did get me thinking though about maybe dealing with it before I use sed or after with something like you've done or a case statement and then I thought about temporarily substituting "://" and putting it back afterwards. The conclusion is I managed it in sed using temporary string substitution:

If so then this does the trick: echo $input |sed 's# \[\[#// \[\[#;s#|#|//#;s#\]\] #//\]\] //#'
You need to escape "\" the "[" and "]" characters as Bash uses them to evaluate expressions: [ -d /root ]&& echo GOOD

I guess this could be done with sed pattern holds and buffer manipulations which I don't really comprehend. Your solution is to the point and much easier to understand (none of those strange char combinations that require a lookup)

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum