• Complain

Rufus Stewart - Bash Scripting: Everything you need to know about Bash

Here you can read online Rufus Stewart - Bash Scripting: Everything you need to know about Bash full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2020, publisher: Independently published, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Rufus Stewart Bash Scripting: Everything you need to know about Bash
  • Book:
    Bash Scripting: Everything you need to know about Bash
  • Author:
  • Publisher:
    Independently published
  • Genre:
  • Year:
    2020
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Bash Scripting: Everything you need to know about Bash: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Bash Scripting: Everything you need to know about Bash" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Bash ScriptingEverything you need to know about BashWhats a shell, and why should you care about it?Any recent computer operating system (byrecent, we mean since about 1970) hassome sort of user interfacesome way of specifying commands for the operating sys-tem to execute. But in lots of operating systems, that command interface was reallybuilt in and there was only one way to talk to the computer. Furthermore, an operat-ing systems command interface would let you execute commands, but that wasabout all. After all, what else was there to do?The Unix operating system popularized the notion of separating the shell(the part ofthe system that lets you type commands) from everything else: the input/output sys-tem, the scheduler, memory management, and all of the other things the operating system takes care of for you (and that most users dont want to care about). The shell was just one more program; it was a program whose job was executing other pro-grams on behalf of users.But that was the beginning of a revolution. The shell was just another program thatran on Unix, if you didnt like the standard one, you could create your own. So bythe end of Unixs first decade, there were at least two competing shells: the Bourne Shell,sh(which was a descendant of the original Thomson shell), plus the C Shell,csh. By the end of Unixs second decade, there were a few more alternatives: theKorn shell, (ksh), and the first versions of the bash shell (bash).IntroductionWhat is shell propmt?When does paralysis begin and end?CommandsSimple commandsComplex commandsCompound commandsWhat is shell script?The advantages are found only in bashWhat is interactive chance?Chapter OneCreate and run the Bash programWriting and namingIn which coincidence will the program work?Add commentsChapter IIBash environmentShell initialization filesVariables in BashTypes of variablesClassify variables based on their contentCreate variablesExport variablesThe difference between * $ and @ $Recycle shell programs using variablesQuote characters in BashUtility quote typefacesCharacter escapeSingle quotation marksDouble quotation marksLocalesExpansions in BashExpanded swastika {}Length Expansion (~)Substitution of commandsComputational expansionProcess substitutionExpands file namesAlternative commands in BashUtility alternative commandsCreate and delete alternate commandsFaster functionsChapter IIIStereotypes in BashRegular ExpressionsThe difference between basic and extended stereotypesGrep commandGrep command and typical expressionsAxes of lines and wordsCharacter TypesWildcardsMatch patterns using Bash featuresCharacter RangesChapter IVConditional structures in BashExpressions used with ifThe commands that follow are thenScan filesCheck the chance optionsSimple applications on the if statementText comparisonsIf / then / else is builtThe difference between [] and [[]]Examine the command line argumentsThe names of files that contain spacesNested if statementsLogical operationsUse the exit statement with ifChapter VRepetitive tasks in BashEpisode for in BashHow to make a loop for iterativeExamplesBasename commandWhile loop in BashHow to make a while loopWhile nested loopsCalculate the averageUntil loop in BashHow to make a loop untilThe Break and Continue commandsBreak commandContinue commandChapter VIFunctions in BashWhat are functions?Functions SyntaxPosition coefficients in functionsDisplaying FunctionsRecyclingAdjust the pathunset pathmungeChapter VIIWriting interactive Bash programsView user messages in BashInteractive or non-interactive programs?Use the echo commandGet user input in BashUse the read commandRequest user inputRedirection and file descriptorsRedirect errors

Rufus Stewart: author's other books


Who wrote Bash Scripting: Everything you need to know about Bash? Find out the surname, the name of the author of the book and a list of all author's works by series.

Bash Scripting: Everything you need to know about Bash — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Bash Scripting: Everything you need to know about Bash" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Introduction
Is a program that works to receive commands from you and then ask the kernel to execute these commands. Ie acts as an intermediary between you and the operating system or in other words it represents the outer layer or interface of the system, it takes orders from you and gives you the result. Then it shows the inductor again, indicating termination, and waiting for you to enter more commands. This is why the shell is called a command interpreter, which is similar to command.com in windows. It also contains a programming language similar to high-level languages is very strong through which you can solve any problem you face.
What is shell propmt?
The inductor, whether it is% or $, depends on the type of shell you are using.When the prompt appears, it means that the shell is waiting for you to type the commands to execute.If you have entered the system as the root of any system administrator, the prompt will appear.
What is shell propmt?
The inductor, whether it is% or $, depends on the type of shell you are using.When the prompt appears, it means that the shell is waiting for you to type the commands to execute.If you have entered the system as the root of any system administrator, the prompt will appear.

The following are the advantages and disadvantages of each type of shell quickly: The first type includes: The Bourne shell and symbolized by sh The Korn shell and symbolized by ksh The Bourne againshell and symbolized by the bash The second type includes: C shell TENEX / TOPS C shell TCSH The beginning of the shell was with the Bourne shell where stephen R.Bourne wrote it on the unix system in the mid 1970's at the AT&T lab. Therefore, some call it the shell, "The Shell," because it first appeared. This shell is usually located in the path / bin / sh As mentioned earlier, the shell is a command interpreter and also contains a programming language using syntax formula ALGOL language, and contains the following things: Variables, functions, program control commands, repeating commands, processing commands, mathematical expressions, etc. All the Bourne-type types share these features, but the disadvantage of this original type is the difficulty in using it. There is no auto-complete feature, and there is no save command that has been executed. Ten years later, in 1980, Bill Joy wrote the C shell, avoiding the difficulty found in the previous type and also making the syntax formula from ALGOL to C language.

Some of the features found in it: The property of completing the text, save previously written commands. Usually we find this shell inside the / bin / csh path Its disadvantages are: Weakness in supporting I / O operations lacks functions, so it is not recommended for programming, only for use. The TENEX / TOPS C shell, symbolized by tcsh, is an improved version of the cshell where additions of many features, including the use of the arrows (up - down) to view the commands that have been executed as well as the arrow (right - left) to modify these commands. At this time, after two types of shell were available, David Korn in AT&T wrote the Korn shell and symbolized by ksh It combines the ease of the C shell, as well as the Bourne shell, making ksh the preferred choice for many users. In general, the ksh is compatible with the first type, which is the sh. There are 3 copies of this paralysis: The official symbolized by ksh which we talked about and the public domain and symbolized by pdksh and finally the version of Desktop and symbolized by dtksh.

Shell programmers often use the first and second versions. The third dtksh is for Shell users. The ksh is usually found in the / bin / ksh or / usr / bin / ksh paths.Other versions can be downloaded from the net if it does not come with your system. Finally, the Bourne again shell, which is currently used in most distributions where the developer Brian fox collected the previous features and put it in it so it is now preferred and is usually found in the path / bin / bash or path / bin / sh where it became the default shell.

When does paralysis begin and end?
When you log on to the system, getty starts to work where you are asked to type your username and passwords and then passes it to the login program that checks the entered data, by comparing it with / etc / passwd and it looks like this: SudaNix: x: 500: 500: ahmad: / home / SudaNix: / bin / bash In the case of matching, the paralysis in the file will be executed, in this case is / bin / bash and when you exit logging Shell ends work and to change the type of paralysis change it by typing the command: / bin / csh Here changed to Cshell and exit Interactive and non-interactive paralysis !! When you see the prompt prompt, this means that immobilization works interactively interactive, I mean interactively, that is, you are expected to write commands to execute This is the usual normal situation where you enter the system, then the immobilization begins to work .. Then you write some commands, and exit the system Shell is suspended.

It is contradicted by non-interactive paralysis: It means that there is no interaction between you and Shell, that is, you will not be waiting for you to write any commands, where he executes commands saved inside a file and when it reaches the end of the file stops working and this is known as the script. Two basic concepts are:

Commands
It is a program that you can run by typing its name and then press enter. Example: The date command shows the day, the date, the hour. Note that the $ prompt is reappeared and this indicates that the program has finished executing. Another example is the command, which shows the names of all users of this system in addition to some information and there are several types of commands, namely, simple commands, complex, complex.
Complex commands
A simple program name plus one or more arguments.
Complex commands
A simple program name plus one or more arguments.

An example to make it clear: As mentioned, we give you information about all users and their access times to the system, but by typing it: The username you are working on and the time you access the system. So am and i are intermediaries who interfere with who adjusts his behavior. Most of the existing commands accept many arguments that change their default behavior and we will see that later.

Compound commands
They are commands that combine simple and complex commands. They are separated by semicolon; Example command: date; who am i; This complex command executes the simple command date first and then executes the complex command whoam i and commands are separated using a semicolon and if not placed, ie the command is written as: date who am i will happen an error .. etc). etc).

He can build chairs, tables, cabinets, etc. Using the same tools, but with a certain composition, he can build anything he wants. This example is very similar to shell scripting. To build anything you want, you must use the right tools and call them commands or programs, which are mentioned above. Write the first shell script: Open any document - Text file - and type the following: date; who; Save the file by any name and let it be sudanix Now you run this script, type: / bin / bash sudanix Now the result will appear which is the output of the date command and the output of the command who. To convert a script into a scriptable executable ?? One of the most important steps, in order to make the file executable ..

Any we execute by name only. she: Convert the file into an executable file by command chmod a + x ./sudanix But we have to make sure which shell will be used. Because we don't guarantee that all shell users are working on bash, we will add this line to the start of the script. #! / bin / bash Note that this line at the beginning of the script. Specifically in the first line !! Otherwise, the script will be as follows: #! / bin / bash date; who; Now to execute this script write it on the following form with a note to be in the same folder that contains the script. ./sudanix The bash shell is the default shell of the GNU system The GNU project, referring to GNU's Not UNIX, provides tools for the management of Unix-like systems, free operating systems that comply with Unix standards.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Bash Scripting: Everything you need to know about Bash»

Look at similar books to Bash Scripting: Everything you need to know about Bash. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Bash Scripting: Everything you need to know about Bash»

Discussion, reviews of the book Bash Scripting: Everything you need to know about Bash and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.