[Autogenerated] Now to be able to process our file,
we have to work with the record separator variable.
We can open up our virtual host dot org file.
It's going to be easier to have this in an org file.
Although we could do it from the command line with our open,
we can go through in our begin block, we can set our R S or our record separator.
Now by default, this is a new line.
We want it to be two new lines,
but we might also have to cater for any amount of white space in between.
I can't just put slash N because slash N would be escaping the end.
We need to escape the escape.
So it is red as a new line.
So we use double back slash N for a new line,
double back slash S for any white space and having the asterisk after that
means we can have any amount and then we have another new line.
We just have to use a double back slash in front of the
N and the S so it's read correctly,
we can go through and put in our pattern as we saw before.
So we can search for data and then we can print it to implement it.
We can use or minus fi set our pattern and then reference our
org file and our virtual host configuration.
Now, of course,
the very best way to be able to see this is to move out to the
command line searching our virtual hosts by implementing the R S
or our record separator variable.
Come on, come and join me.
Now, as we know,
we have already left our wonderful virtual host file in a nice and clean format.
So if I go through and take a look at my vs dot com,
it's great for me to be able to read on the screen.
But if I had more entries,
it would be more difficult searching the entry that I want for us.
A complete entry is between the virtual host opening and closing block.
So this is where arc can come in useful for us if we go through
and clear the screen and let me go through an VM and we can create
then our virtual host dot org file.
If I go through and hit, enter on this,
we know that we're going to begin with our SSH if we
want to keep it as tidy as possible.
So slash bin slash arc and then minus F,
we don't need that, but we might as well add that in.
Now with that in, we can then get into our arc coding.
We could set up our begin block.
I'm going to keep it on one line here.
So I'm just going to open my brace brackets and we can set our
record set or our record separator equals.
And then in double quotes, essentially,
what we want is a new line followed by a new line.
Wherever we have those double new lines,
then that's really what we should be looking for for our record separator,
but we've got a couple of problems.
The first problem is slash N is escaping the end.
We want it to be seen as a real new line.
So we escape the escape.
So we can see that's being interpreted as a new line.
We also might have unintended white space between those new lines.
So we can put then our back slash back slash s for any white space
and any amount of it is denoted by the asterisk.
So I know it looks a little bit curious but it will work.
And this is the way we set it up next.
We want to be able to search so we can go through implementing as
we did before by looking at then our complete record and going
through and searching for our pattern.
The tilda is the match operator.
So we can use regular expressions in our pattern variable.
And then we want to go through in our main block and print the complete record.
Now, with this implemented, we can go through and save our change.
We can always cat that file out if you want to make sure
that yours is looking good as mine.
Now as we go through, if I just use arc minus V,
we can set, then our pattern equals let's say example.
So we're looking for the string example,
we can reference our virtual host dot org reading in from our os dot com file,
hit the big entity.
And you can see then where the string example is.
We're seeing the complete record.
Obviously, the record now is spanned over multiple lines.
This is exactly what we want.
And if I go through and say, look for Penguin being the urban Penguin,
I just need to put in part of the string,
we can go through and put in Penguin and we just
get the Penguin site coming back.
So this gives us a really simple way to see our virtual host
definitions by searching for the hostname but not just getting
the server name line coming back.
We can see the complete definition.
This is where org is really starting to get very powerful.
Now, there's not too much to type up in our arc file,
but the virtual host dot arc file is also provided
for you in the git repository.
Should you want to make use of it?
But as always ID do promote the use of your own typing.
So it goes in just a little bit better but don't get stuck,
do research the files within our repository.
And hopefully you can get yourself up and running very quickly.
Why don't we go and take a look at summarizing a little of what we've seen.