Let’s create the most that neither is a simple script-shl to update the system. And then I’ll show you how to add useful scripts to your system for convenient use.
First of all, let’s understand what is script and what is it for.
We all watch movies, many of us – performances. To create a movie/show, the writers write the scripts to them on the basis of which actors, scene for scene perform on stage their roles. Work on creating a script rather laborious, where it is necessary to consider all the details that in the end, the artists were able to perform the intended writer, and the viewer saw a complete work.
Similarly, to write scripts to perform tasks the user is together (code) to make their implementation easier and faster in the operating system. For writing simple scripts does not necessarily have education as a programmer.
First, let’s create the most that neither is a simple script-Shell to update the system.
So, open a text editor and enter in it the first must-have characters called shebang.
Next, the following line should be a description of what needs to run our first script:
The sign (#) at the beginning of the line makes it clear to the interpreter/terminal that the string do NOT need read and do NOT need execute. Line is necessary in the code of this script to the Creator of the script knew what he was going to perform on this stage in code, to avoid confusion in future when these lines will be a lot. Such lines with the pound sign is called is commented.
Next, the script followed by running the line command, in this case to update the system:
-y at the end of the second command makes it clear to the interpreter/terminal that this action/command needs to be run automatically, without additional confirmation by the user pressing the Enter key.
y – short for yes
Save the file/script and give it a Name with a required extension at the end .sh. Extension .sh is assigned to the executable file.
I gave it a Name – update.sh preserving the Home folder of the user.
To create a file/script was executable, you must give him permission to do so. This can be done in two ways.
Run the following command in the terminal:
Or right click on file => Properties => Right and activate the item – Execute: Allow executing file as a program:
run the sh script:
You can find the Internet useful scripts and use them in the system.
To use it easier to use some scripts, you can assign keyboard shortcuts to launch them or you can use hot corners.
For example I added in Nemo
If you add the script to the shell of your file Manager will probably need a restart.
May the Force be with you,