 Okay, today we're going to be looking at aligning the output of some commands next to each other. Now, I've talked about this in the past. If you search my channel for paste the paste command, you will find a video where I go into more depth on the paste command doing different things like taking lines from a file and lining them up and making a CSV file out of it and that sort of stuff. But I'm going to show you something based on a question someone asked. So the question they asked, where did I put the question? Here we go. Hi, Chris. Hello. Please help. How would I, you, how would you said, wait, yeah, how would you said some to do info along with the Cal program? Watch one of your videos on said, figure out that I can print something right beside calendar, and he gives a command that he tried, for example, but I can't find a way to print my to-do list to the right of my calendar. I can print below it as a separate command, no problem. Would be nice if you could help me figure out how to print or echo one command to the right of another. Thank you for inspiring your inspiring videos. Okay, I'm going to show them do that. We're not going to use said, we're going to actually use the pace command as I already mentioned. So let's have a quick look at the pace command. I have two files in the current directory, file one text and file two text. I can cat out file one and display that I can cat out file two and display that I can cat out both file one and file two and they display below each other. How do I get them to display next to each other? Well, I can just use the pace command. I can say paste and give it file one and file two and it will put them next to each other. But I cheated a little bit here. Okay, you're ready for this. This is how I cheated. If I go into the file one command or text file, you can see the text here. I cheated by putting extra spaces at the end of these lines to make them all the same with. So if I was to remove those, let's see, remove that. So I'm going to do, do, do. So there's no extra spaces at the end of that. And now I was to paste them. You can see that these bottom lines aren't aligned properly because these lines are shorter. And what it's doing is it's going to the end of that line and then adding a tab and tabs might display differently. So how do we fix that? And there's a number of ways you can do it. The simplest is probably the column command. As I just mentioned, the pace command is using tabs to space out between the two files. So if I was to run that same command again and pipe the output to column and say basically to separate by tabs, that should align things properly based on the number of tabs in the file. I think that should work with most files. Okay, so but we're talking about files here. So he was asking about the output of commands and you can pipe the output of commands into paste, but then it uses each line of that to align differently. So there might be a way to directly do two commands into paste. I'm going to cheat and just dump stuff into a text file and then align those text files. Now, I don't know how he's doing his to-do list. I'm going to assume that it might just be a text file or he's running command that displays the text, which he can then dump into a text file. So what I'm going to do is I'm going to create a script here that will basically create two text files and then paste them next to each other. And I'm going to do this very simply and I'm not going to clean up. I'm going to throw some the output into the temp folder on the machine and I don't clean them up, but you can clean them up and it all just customize it to your uses. So I'm just going to call this which I call this script. I guess I'll just call it output.sh, okay? And of course, we're going to give it a shebang line because this is going to be a bash script. So we're going to want the Cal command. So if we just type Cal, you get your calendar like this and you give it other options too, but basically he wants to have this output here with his to-do list over to the right here. And we don't have to worry about the whole column thing here with this particular command because Cal is going to have everything aligned properly already. But I showed you that in case the output of your command does not, or if you wanted to have the to-do list on the left side in the calendar on the right, you'll have to add that column command there. So let's go back into here. And so I'm just going to say Cal and I'm going to redirect that into a file called myCal in my temp directory. And then I'm going to create a to-do list. I'm just going to say something like take out trash. I'm going to say clean bath room, go for a jog and we'll say pick up supplies. Okay. And we're going to put that and again, that could just be one command, but I'm just creating a text file here. You might already have a text file, but I'm going to say I'll call this temp my to-to-do list. You can see I've already done this in a test because those files already exist. So I'm not checking if those exist. I'm just creating them or overriding them. And really you should put file names like that and variables on your scripts and then clear them out after. But what we're going to do now is just going to say paste and we're going to give it that first file name, this right here. And we're going to then give it the second file name right here. And that should be it. Let's go ahead and make our script executable and we will run it. So I'll just say output.sh and there we go. We have our calendar with our to-do list to the right of it. So I hope that answers your question and I hope you find it useful. The paste command can be very useful when you're trying to align things like this. Again, the Cal command does give you perfectly spaced lines, but if your output command doesn't or if you're doing a text file that doesn't necessarily have all lines the same length, you'll want to add that column command that I showed you. But check out the link in the description up at this very basic example up on PasteSpin. If you like my videos, think about liking, sharing, subscribing, commenting, all that good stuff. You can also support me over at Patreon.com. If you're a patron, it's a lot easier to get a hold of me if you have questions. But as this example was a comment on one of my videos, you can comment below this video. But I have a lot of videos and I don't check the comments on all of them. So if you do have a question you want me to answer, your best bet, if you're not a patron, is to go to my most recent video and comment there because I do try to check the comments on my most recent video or two. So thanks for watching. Filmsbychrist.com. That's Chris with the K. There's a link in the description of my website and a bunch of other goodies you can search through my videos there. And I hope that you have a great day.