Getting online help.
Now this is the most powerful tool that you have that you could utilize while you are writing a script
or you need help writing a script.
Well let me tell you this not everybody is perfect with their expertise that people always learn always
learn and you're not going to find anybody in the world who will say hey I got it all.
I know Matt I know everything about Matt.
I know biology.
I know everything about biology.
So what I'm trying to say is everybody even if you become expert you will still learn newer things.
So people who are very proficient and expert in writing scripts they still need help.
They sometimes get help online.
So they actually go help other people and also get help online.
So if you're writing a script today.
So let's pick an example let's say if you want to write a script today and you need some kind of a syntax
in your script and something is not working for you you know don't waste time.
Go online ask questions.
It's OK.
We don't know everything inside on our head sometimes we do forget.
So that's what this lesson is about is getting your online help.
You should use all online resources.
What I mean as if you writing a script and you need help go online and use online resources like Google
Yahoo Bing search or what ever the search engine of your choice.
People actually start writing questions nowadays with websites like Facebook or Corra or there are so
many other Web sites you actually go and pay your questions.
And you know what happened within few hours your questions is answered.
Now how people are answering your questions when they don't have interest in spending time for you.
Well first thing is people most of these people are nice enough to help other people out.
That's one of the reasons they actually help out.
Plus if you help someone you are not actually making a difference or actually doing a favor to them.
You are actually improving your own skills.
So that's why I go online try out all the resources that are out there.
Second when you search online try to make a precise search meaning don't just have a vague search like
linux shell scripting.
Well you're going to get the essence of office search results.
But if you are looking for Linux if else statement you will get exactly if statement.
But if you're looking for a specific error that you get from a false statement you will get that to
Pacific be precise.
Then next one is second opinion.
What I mean is if you find a search an article on a Web site that someone has offered that you should
do the script this way then just don't be done with it.
And it's like hey I found my search just copy and pasting even you to understand.
No.
Go ahead and look for another search.
Maybe you'll find a better search an easier one that you will though make understand what this is about
and how the scripting works.
Then ask questions.
What I mean what I mean by ask question is if you are trying to look for something and that is not already
answered by the community then you could post your question on line.
If you're writing a script to actually delete certain servers or to wipe out or do Passhe management
on your system and you want to delete those patches that are no longer used by users so you need help
go put that question online.
And I tell you this people will answer.
People will reply to you question read the right script.
So this way you will learn as well.
Then at the end create your documentation when you write whenever you sorry whenever you get something
from someone.
Write it down on the documentation that's one of the things I always do I write it down because a year
or two year or five years from now I will forget.
So I write down on the documentation and once you become yourself and expert a profession.
Please go and help others.
Don't forget that you were help once and people help you.
So now when you become good at something go and help out others now it's your turn to return the favor.
All right.
OK.
So this is all about how you get online help.
Not let me go and open up my browser and I'll show you exactly what kind of help that you get if you
are trying to run or write a script.
So let's go into my browser.
I have opened up my browser.
I like Google so I pick Well again don't go by my preferences you could pick any search engine that
you want.
So if you want to do let's say existe That's right.
You want to learn more about access data and how that works.
You could do Linux.
First of all you always start with Linux because it's operating system.
Linux exit status in bash because you didn't bash script and you are going to find it tons of article
tons of information about Linux.
See how do you exit in a command line and distending exit codes and how to use them in bash script.
So before you could come in and ask me a question.
Not that I'm not going to answer.
I would love to but I would encourage you to go find the answer on line yourself.
This will help you in your real life career wherever you are working see you see you have a lot of articles
here.
People have put in articles our understanding exit codes how they work.
Spend some time reading it and you'll see right here.
They have given also examples touch cannot touch arrest Tezz permission denied.
And the echo and their exit status is zero.
File Ron all the different commands all the testing for codes.
Look for it.
See right here if dollar question mark equal.
Then Ecko successfully created file.
Else could not create a file.
So this is right here.
They used this exit code right here so it's about exit code and let's say if one or the one of the script
that we written in our course was check a process and kill it.
So let's say if I wanted to actually do that exact same thing check process in Linux and kill it symbol
is that check up process and then X and kill it find and kill process.
You see see how easy it is a guide to kill kill and kill all commands to terminate a process.
And here you have this Web site meant that explains you how you could find the process different commands
to find process and what commands to kill that process.
If you want to do automate you could actually go and put your search precisely check a process and then
X and kill it and put it a script to check and you'll find shellscript to capture process ID and kill
if it exists.
You have to be specific what you are typing.
So click on it and you'll find see right here.
People have written the script already for you.
So you don't have to actually spend time and troubleshoot your scripting code if it doesn't work.
You could try these out and basically encourage you to try every lesson that be covered in our in our
class tried to see people if see if people have a script written in a different way.
See there people have answered people have questions that probably Randles.
I tried this code and it is not working.
Well you could also look for the what is wrong with this code.
And then you'll see answers right here.
This is this works good for me.
Perfect.
And then you try this.
This will make you real real good in scripting basically anything that you want to do in life you want
to you get answers and then eventually you answer people once you gain knowledge on that.
OK.
Going back so let's say one of the script that we wrote was list
this all users who are logged in so I'll do a script to list all logged in users in Linux.
Make sure because we need a script to list all logged in users invest in Linux.
If you don't put Linux then it probably gave you the information in Windows as well.
Because remember in Windows you also write script and those scripts are bash scripting.
So not bash PowerShares scripting.
So every operating system has scripting capability.
So make sure you type Linux anyway.
Unix Linux less current logged in user Luzzi bash list logged in users named terminal Fourways to identify
who logged in in your Linux.
So many things that you will find.
OK so now that say you want to give more examples of 4 scripts you could do for loop script examples
since for loop mostly is in shell scripting.
But I would say put in Linux for loop script example Linux bash for example see if you click on it you're
going to find so many examples right here.
These people have or you could try different examples.
So many of them see what people has to say what are the issues they had
next bash shell script for bash for loop
see how to loop through a list for number 1 to 3.
Do it go number 2 and exit.
So basically what I'm trying to say is I'm not going to go into more detail about searching.
I think you understand now that what exactly I'm talking about so I'm saying is go ahead and use your
resources.
Don't limit yourself to a book or two.
Even my course or to a person that you rely on this world is open for the whole war wants the Internet
was introduced.
So you have a whole world on the palm of your hands on the lap which is your laptop so go ahead and
open up your search engine and type it anything you want and you will find tons of resources out there.
So that's why my focus says even if you are in Windows or Linux or in any kind of capacity utilizing
utilize the search engines see how you could use the search engines and this way you don't have to rely
on anybody else.
So try it out different searches and I'm sure you will find the answers that you're looking for.
And once again good luck.