[Autogenerated] And look at this, the sunset.
Well done.
Congratulations.
Look where you've got yourself too.
And I really hope that you feel you're picking up a
lot of really useful information.
So we've been looking at using sd and we started off
by using sd with line numbers.
And among other things, we looked at how we could print,
let's say just line one or the last line.
Remember the last line is the dollar character.
We can also delete lines as well as inserting an app pending.
But here we're deleting lines one through to three
inclusive using regular expressions.
We're able then to go through and search for text so we
could go through and just look for server name and print
that line from our V hosts file.
We could substitute text so we could look at the word _____ and replace it
with W W W we could look at tidying up configuration files.
So we've already seen with re app that we were able to go through
and reverse our expression and print those lines that didn't begin
with a comment or an end of line marker.
But we've seen the problem that some configuration
files aren't that straightforward.
Some might have indented comments so we can add in the
forward slash s for any white space character and the
asterisk for any amount of those characters.
We could also store that as we saw as an alias to use.
Then our clean file alias to be able to work with any file to list the
contents of the file without the comments and empty lines.
Something that was very useful was seeing how we could
print out blocks of text by specifying the first text to
look for and the ending text.
So where we have formatted text where we might have XML style blocks,
we're able to print the opening block all the way through to the closing block.
So these are just some of the things that we've looked at with sd,
but it's a matter of being certain of everything that
we've looked at and practicing it, not just as you're going through studying it,
but thinking where you can use it in your own life,
the only use of sd is that it is going to be useful to you when
you're running your administrative tasks.
So you've got to be able to find times that you can
use it and be confident of using it.
So practice it on your test systems.
Once you're certain it's working the way that you want,
you can then start moving it on more live systems,
but good luck and be confident we're not finished though.
Yet with sd,
we've got a little bit more work to go through and we can take a look at how
we can do a little bit more advanced editing using sd.
So creating things like sd files as well as using sd
within scripts to try and automate some of our processes
and editing across our network.
So I'm going to see you back in the next module, hopefully very soon.