http://www.jb51.net/article/33899.htmLinux shell custom functions (definition, return value, variable scope) IntroductionThe Linux shell can be user-defined functions and can be called casually in shell scripts. Here's how to define it, and what to
The Linux shell can be user-defined functions and can be called casually in shell scripts. Here's how to define it, and what to call attention to. I. Defining shell functions (define function)Grammar:
[Function] funname [()]
{
The Linux shell can be user-defined functions and can be called casually in shell scripts. Here's how to define it, and what to call attention to.I. Defining shell functions (define function)Grammar:
[Function] funname [()]
{
Action
First, define the shell function (define functions)
Grammar:
[Function] funname [()]{Action[Return int;]}
Description
1, can be defined with function fun () or directly fun (), without any parameters.2, the parameter returns, may display adds:
This is a creation in
Article, where the information may have evolved or changed.
For the definition or understanding of the Golang function:
function is the smallest modular unit in structured programming, which breaks down the complex algorithm
A function is equivalent to a function block, and when it is to be used, it can be called directly, avoiding the base code.function definition and use:1 #function2 defMail ():#Defining Functions3n = 123#function Body4n + = 15 Print(n)6Mail
The Linux shell can be user-defined, and can be invoked randomly in a shell script. Here's how it's defined, and what the call needs to pay attention to.
First, define the shell function (define functions)
Grammar:
[Function] funname [()]
Swift2.0 The return value of the function in the language tutorial and the function type Swift2.0 the return value of the functionFunctions can be divided into non-return-valued functions and return-valued functions, depending on whether they have
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.