[Autogenerated] Now, we are really going to start unleashing the power of SSD.
And I know I've said this before, but believe me,
you are going to be impressed with this when we start looking at Apache.
And although this is specific for Apache,
the same basic idea could be used across more or less anything.
We're looking at blocks of code starting with a directory tag that will
open it and forward slash directory that closes it.
If we want to print the ETags and everything in between,
then we could do similarly to the way we were working with our numbers before
and comma separate our strings and regular expressions.
So as we go through and take a look,
our first regular expression is just looking for forward slash directory,
we comma separate it and then we move on to the second closing directory tag.
Now the closing directory tag is going to be forward slash directory.
Now, unfortunately, we do use forward slashes to delimit our regular expression.
So notice the back slash in front of our forward slash
meaning that we should read that as a literal rather than
having any special meaning behind it.
I could put the closing greater than symbol after the directory,
but there should be no need.
So we've just got the close of the string and then we print and
we're looking at the vs template that we made a copy of earlier
inside of our test or working directory.
Now, we're going to move directly out to our command line.
So we can see this,
seeing how we can work with blond and being able to print
these directory blocks within Apache.
The reason why we're doing this is its going to give you much
greater control over what is going to be printed,
being able to isolate the stars, an end of the text that we want to look at.
So come on, let's find that command line.
And here I am,
I'm already my test director and this is where my vs file is going to be.
I remember I want the edited file so I can go through and show just the top 10
lines to give me an idea of what I have inside of the file.
And we can see that I've got, let's say my server admin and my server name.
Now let's just take a very simple example where I want to be
able to print from server admin to server name.
I can go through then and use my set command, suppress my normal output.
We don't want to print the complete file,
we can open up our set expression and then we put our regular
expression or texting that we want to search for,
for our beginning text.
So where we have server admin,
we can close that off and then comma separate it from the closing text just
in the same way as we were printing a range of numbers.
We had one comma three, I can go through now and put server name.
Remember these are case sensitive and we can then put our pattern,
match, close our expression and then recall our vs dot template.
So very simply we've got server admin and server name.
Now we're not saying print these lines, we're saying print everything between it.
But I suppose only having the two lines and nothing in between.
It doesn't really help too much.
So we extend it a little bit going from server admin
down to our custom log and custom, I feel is spelled with an o not an you.
This is why I don't edit files.
I like to have systems edit them for me.
But we can see now we've got server admin,
server name, document, route error log and our custom log.
So we can print the two lines that we specify and everything that comes between.
Now, if we want to extend this into something really useful,
we can start looking at blocks of code.
Now,
we know within our Apache configuration as we've already seen from the slide
that we have directory blocks that will open with less than an directory and
close with less than forward slash directory.
So as we put in our second string,
we have to escape the forward slash for directory.
So we know that it's not a meta character being used by sd.
I can also close off this tagger one as there's
nothing that follows the word directory.
But now we're looking for the opening directory,
tag and the closing directory tag.
And look,
we actually have two directory definitions within
our virtual host configuration.
And we've been able to print both and all of the elements of the configuration.
Now, this I guarantee you is really powerful.
And although you might say that you're never going to work with,
let's say Apache, as we're looking at here,
really the same configuration could work for us within XML data.
But the idea idea is that we're giving you some features to look at.
So you're able to think how you can isolate data within your data format.
But this,
I guarantee you is really special and you're going to be able
to love to use it in your own environment.
But come on, let's move back to the slide.
So we might summarize a little of what we've looked at.