[Autogenerated] And welcome to our first demonstration where we're going to
take a look at managing our complexity using our sd files.
So we need to understand our set files to begin with.
So we can look at creating a simple set file that
allows us to group expressions together.
We'll also take a look at how we can not only edit a file with sd,
but we can automatically create a backup.
Come on, let's go through and take a look.
And here we are then at our glorious command line,
our pixel playground where our learning is going to begin.
Now, we do have a copy of an SSH D configuration file that we can work with.
This way,
we can gain confidence in our edits without the worry of messing our system.
So we can go through and copy from said and org,
the course repository directory.
And in here we've got an SSH D underscore config file and we
can copy across to our current directory having copied it if we
go through and take a look at it.
So C SSH D underscore config we can see that it is a standard
configuration file that's heavily commented.
Now we know we can get rid of these comments using
an enhanced regular expression.
But we can also put multiple expressions together on the command line.
So if I use said and we can go through and look for lines beginning
with the end of line marker and we can delete those.
Now, this in itself is an expression.
I could close off my quote here.
But TIFF, I put in a semicolon,
we can put in multiple expressions so we can then go through
and say lines that begin with a comment.
We can also delete these and then look at our SSH D config
so we can put everything together and have multiple
expressions following each other.
Now, whilst this is OK, obviously, if it extends too much,
it's going to be one awful line that we are writing.
So another way that we can take a look at is our said file.
So if I go through an VM, let's just call it,
let's say test dot Said,
I'm not so worried about the name so we can get into editing our file.
We don't need to worry about putting in our quotes and in fact,
we shouldn't put in our quotes,
but we then just go through and say lines that
begin with the end of line marker.
And we want to delete those lines then that begin with our comment and
we want to delete these and that's all that we need.
Now, I know this is very simple.
But the idea is that we're going to get some great
experience using these sd files.
So once we save that, we can then go through and do a sd minus F,
make a reference to our test dot sd.
And then we can go through and work that against our SSH D underscore config.
Now, we do know that we can edit the file because at the moment,
we are just printing to the screen,
but there's nothing stopping us moving to the top of the screen and
then running our minus I for our in place edit.
And if we follow that with ad dot And then whatever extension that we want,
we can just have a simple dot back up.
Now as we go through and execute, we have edited our file.
As I look at the SSH D config we can see now that that has been edited.
However, we also have the original file.
Let me copy it back, copy our,
our SSH D underscore config dot back through to our SSH D underscore config.
And of course,
now if I go back and look at my SSH D config we're
back to the way that we were before.
So again, this gives you the great ability to gain that confidence,
knowing that you can always return to your original file if
you don't like the edit that has been done.
Now, this then shows us our simple set files,
but why don't we move on looking at something a little bit more complex.