Linux: This Book Includes 4 Manuscripts. The Underground Bible to the unix operating System with Tools On Security and Kali Hacking to Understand Computer Programming, Data Science and Command Line




Download 6,34 Mb.
Pdf ko'rish
bet113/203
Sana10.01.2024
Hajmi6,34 Mb.
#134102
1   ...   109   110   111   112   113   114   115   116   ...   203
Bog'liq
Linux This Book Includes 4 Manuscripts The Underground Bible

Variables
Variables in bash scripting are essential in completing the whole script. The
user has to assign variables and meanings to them. For example, one can
assign the letter X a variable. On the script, one will type as follows.
#!/bin/bash
X= “1.”
The variables mean that the user when they insert a certain variable in the
code, suggests the value assigned to it. It helps to shorten the number of
words in the script. Retrieving the variables involves typing the variable
and syntax echo on the terminal. The process will go as follows.
echo $X
1
Syntax and the signs that are used in the development of the script are
essential. Failure to use the right signs and syntax will mean that the results
of the program will not be the same as expected. Therefore it is essential to
get the syntax and signs right. For example, if one forgets to place the $
sign before the variable they want to retrieve, then the program will give an
undesired result. Care should, therefore, be taken when scripting otherwise
mistakes lead to programs failing to run. Avoidance of errors in the script
involves constant testing of the script in bits completed to ensure that they
are working. Proofreading the script is also essential to ensure that one has
gotten the script right, syntaxes are correct, and even spelling is correct.
Any mistakes in the scripts are reflected in the program. For example,
#!/bin/bash
echo “welcome.”
Instead of
#!/bin/bash
echo “welcome.”
This mistake will mean that the program will display the wrong information
at startup. The program instead of displaying “welcome” will show
“welcome.” therefore proofreading the script is an essential step after
completion of the script and constant running will help to identify such
mistakes .



Download 6,34 Mb.
1   ...   109   110   111   112   113   114   115   116   ...   203




Download 6,34 Mb.
Pdf ko'rish

Bosh sahifa
Aloqalar

    Bosh sahifa



Linux: This Book Includes 4 Manuscripts. The Underground Bible to the unix operating System with Tools On Security and Kali Hacking to Understand Computer Programming, Data Science and Command Line

Download 6,34 Mb.
Pdf ko'rish