Tag Archives: Shell tutorial

Shell Command Test

The command test in the shell is used to check whether a condition is true. It can test numbers, strings and files. Number arguments test Tag Description -eq Integer1 and Integer2 variables are algebraically equal -ne Integer1 and Integer2 variables … Continue reading

Posted in Internet Technology | Tagged , | Comments Off on Shell Command Test

Shell Flow Control

The flow control of shell cannot be empty which is different from other languages ​​such as Java and PHP.The following is the writing of PHP flow control: We cannot do like this in sh / bash. If there is no … Continue reading

Posted in Internet Technology | Tagged , | Comments Off on Shell Flow Control

Shell Command Printf

In the previous chapter we learn the command echo, this chapter we will introduce the command printf. Printf mimics the printf () program in the C library. Printf is defined by the POSIX standard, so scripts that use printf are … Continue reading

Posted in Internet Technology | Tagged , | Comments Off on Shell Command Printf

Shell Command Echo

Echo in shell is similar to the echo in PHP which all output string.The syntax for echo is: You can use echo to achieve more complex output format control. 1. Display ordinary string: The double quotes here can be omitted,the … Continue reading

Posted in Internet Technology | Tagged , | Comments Off on Shell Command Echo

Shell Basic Operators

There are various operators supported by shell.We will now discuss the following operators: Arithmetic Operators Relational Operators Boolean Operators String Operators File Test Operators Bourne shell didn’t originally have any mechanism to perform simple arithmetic operations but it uses external … Continue reading

Posted in Internet Technology | Tagged , | Comments Off on Shell Basic Operators

Shell Arrays

Shell arrays can hold multiple values,Bash shell only support one-dimensional values(can not support multi-dimensional) .We don’t need to define array size during initialization (similar to PHP).The subscripts of array elements start from 0 which is similar to most programming languages. We … Continue reading

Posted in Internet Technology | Tagged , | Comments Off on Shell Arrays

Shell Passing Arguments

Arguments can be passed to the script when it is executed,we can get the arguments by the formats like $n.Inside the script, the $1 variable references the first argument in the command line, $2 the second argument and so forth. … Continue reading

Posted in Internet Technology | Tagged , | Comments Off on Shell Passing Arguments

Shell Variable

When you define the a variable name, the name should not prefix $(excepting in PHP ),for example your_name=”www.linuxcommands.site” We should not add blank space between the variable name and the equal sign which is different among your similar program languages.The … Continue reading

Posted in Internet Technology | Tagged , | Comments Off on Shell Variable

Shell tutorial

The Shell is a program written in C language, it is a bridge use Linux users.The Shell is a command language and a programming language.Shell is a kind of application, the application provides an interface to the user through the … Continue reading

Posted in Internet Technology | Tagged , | Comments Off on Shell tutorial