 Okay, I think this is number four in a series on SED. There should be an annotation on the screen showing you a link to the full playlist. I recommend watching the first three videos before watching this one, and today we are going to be playing around with SED and we're going to see what the ampersand, which is the little end symbol, does. Basically it takes whatever string you're trying to match and replaces it in the string that we're trying to replace it with. You'll see. It'll make more sense once I show you it. So we've been working with this file that I made just for the tutorial. Just has some random stuff in it. A couple lines just for us to mess with. And we're going to use SED and we're going to again do substitution. SED does do some other things other than substitution, but it's probably the main thing it's used for. And here we're going to look at, if you remember our last tutorial, this says look for all numeric characters. I'll just do this and have nothing between the second and third forward slash. It's, oh, again you got to give it an input file. That's just removing those characters. So our zeros, our ones, and our fives in this case all were removed just to show you that. And of course we can replace them like we did with whatever string. I'm just going to say asterisk there like that. But let's say we didn't want to necessarily replace them, but maybe put something around them like maybe a parentheses around every number that it's in our file. So it's simple enough. We know that there's a 10 in that file. We can say 10 and we can say replace all 10s with parentheses 10, but that doesn't get our five and our zero. And so I mean we could go and do other characters because if we were to do this zero through nine, it's not replace, it's not putting parentheses around the five. It's putting a 10 in parentheses in its place. So what we can do is say look for all numbers in this case and put parentheses and the ampersand as representing the match strings. Now we can hit enter and you can see we have parentheses around every number. But we kind of did split up our 10 here. One solution for that and won't work in every instance, but it's one that I know of off the top of my head is if I remember correctly, if I say again this, so again if I do this, we're saying look for a number followed by another number and there's only one instance of that in our file, which is our 10. So we're still missing out on our five and our zero. Now that would work if you were trying to put parentheses around all two digit numbers, but we're not. We're trying to put it around all numbers. And the technique I'm going to show you right here is going to work for all one and two digit numbers. I'll have to look up maybe next week, I'll show you a better way of doing this, but if we were to put an asterisk after that. What this asterisk is saying is look for this or this and this. Basically it's looking at whatever the first part of the string is, whether it has that or one more character after it. So I'm going to hit enter now and in our particular instance, we have parentheses around the 10, around our five, and around our zero because again the ampersand here is saying what string did we match? Put it in here. So we don't have to just do parentheses, we can do whatever characters we can say, oh surround all numbers with three asterisks. There we go. And again, this is saying find either a single digit or a double digit. So again, if we had a three digit number in here, this particular technique would not work. And right now, I'm not sure. I know how to do more than one. I'd have to look that up. Maybe that will come in a future video. Again, you can also use the ampersand more than once. So here you can see we're doing asterisks 10 and then asterisks and then 10 again because we put the ampersand again there. We can also, you know, do ampersand ampersand and that will just double every number, not double it mathematically, but double its characters on the screen. So what do we look at today? The main thing we looked at is the ampersand will take whatever match string we have and put it into whatever we're replacing it with. We also looked at a way to find two characters or one character. You can also do three characters. I guess since I brought that up, we might as well look at it. We got time, right? So let's say in our file, we've got a couple of TH's here and a couple of T's. So if I did T, let's say let's replace all T's with a couple of zeros. So all capital T's. Oh, sorry. I put the asterisk in there. That's not good because it's looking for the T or anything else because there's only one character there. So I can say TH here. That would be an example. And we replaced all TH's with four zeros, but if I was to put an asterisk there, it's going to replace all T's with four zeros, but it's also going to replace all TH's with four zeros. And as you can see, it doesn't do, doesn't replace the T and the H. It's replacing the TH or the T. I hope I'm explaining that well. And if I was to do THR, you can see that it no longer modifies the capital T's. It's modifying all the TH's, capital T, lowercase H, and all the THR's. So the asterisk is basically saying, and I've only used this asterisk a little bit, that's why I'm hoping that I'm explaining this well and properly, it's saying look at whatever this is with and without the last character in it. So I hope I explained that well. It wasn't the main focus of the tutorial. The ampersand was, but I kind of got into that, which is a subject I'm not too familiar with. So it's another thing I need to just learn more about. Anyway, I thank you for watching. My website is filmsbychrist.com. That's Chris with a K. There should be a link in the description. I ask that you check that out. If you enjoyed this tutorial, be sure to give it a thumbs up, like it so that I know you like it. And also it's just really nice to know that people like it. And also, again, there should be an annotation on the screen to the full playlist. This video is being put out on Monday. There's going to be a new said video every Monday for the next couple of weeks. Mondays are always my shell script or Linux general tutorials, and next couple of weeks we're going to be working on said, as if you're watching it now. If you're watching this two years from now, well, hey, these videos are already up. The playlist's on the screen and I might be doing something else on Mondays by then. But be sure to check out the playlist annotation on screen filmsbychrist.com Chris with a K. And again, I hope that you have a great day.