The Linux shell can be user-defined functions and can be called casually in shell scripts.
The functions in the shell are defined in the following format:
[Function] funname [()]
{
action;
[return int;]
}
Description
1, can be with function fun
Shell learning: Shell echo, printf, test command, echotestShell learning: Shell echo, printf, test command Shell echo command
Show normal strings
echo "hello"
Output: hello
Double quotation marks can be omitted as follows:
echo hello
Output:
Redirection, environment variables, and Shell functions of advanced shell script Programming
Shell is not limited to simply executing commands line by line. One of the more powerful functions is the ability to create functions and function
Shell-5.shell echo CommandEcho---display contentFormat: Echo [options] Text-N Do not wrap in the last line-E parsing escape character\a issued a warning sound\c Finally, no newline symbol is added.\f Line break\ r Enter1.-N do not wrap in the last
Tlcl-view the world echo in shell eyes, tlcl-view echo
View the world in shell eyes
Echo-display a line of text
When you enter a command, bash expands the input characters before executing the command.
Expand path
Echo *
Shell expands * to the
1) Unix command:
Although any Unix command can be used in shell scripts, some more common commands are used. These commands are usually used for file and text operations.
Common command syntax and functions:
Echo"Some text": print the text on
The difference between a point command in the shell and the source command1 shell script Execution methodsThere are two ways to execute shell scripts, one is to create a new shell, and then execute the corresponding shell scripts, one that executes
Fundamentals of Shell ScriptingWriting specifications for 1.shell scripts2 variable and special variable application3 Local variables and global variables4 Test-judgment expressionIn some complex Linux maintenance efforts, a large number of
When to use the shell
Because the shell appears to be a common feature between UNIX systems, and has been standardized by POSIX. As a result, the shell script can be applied to many systems as long as it is written "attentively". Therefore, the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.