23.6. Functions

简介:

例 23.7. Functions with parameters sample

#!/bin/bash
function quit {
   exit
}
function e {
    echo $1
}
e Hello
e World
quit
echo foo
		


23.6.1. Local variables

 #!/bin/bash
	HELLO=Hello
	function hello {
	        local HELLO=World
	        echo $HELLO
	}
	echo $HELLO
	hello
	echo $HELLO
		




原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
9天前
|
缓存 JavaScript 前端开发
|
2月前
|
小程序 定位技术
__g is not defined
这篇文章通过分享经典电影对白和英文版的《小情歌》来唤起读者的独家记忆,但具体内容未提及,只展示了一些图片。
|
Dart JavaScript 前端开发
Functions——Dart
Dart是一个完全面向对象的语言,它的方法也是对象,对应的类型为Function。 这意味着方法也能被赋值给变量,或者当做参数传递给其他方法。
|
Dart 编译器
Functions Paramaters——Dart
Dart是一个完全面向对象的语言,它的方法也是对象,对应的类型为Function。 这意味着方法也能被赋值给变量,或者当做参数传递给其他方法。
|
Python
Python编程:Built-in Functions内建函数小结
Python编程:Built-in Functions内建函数小结
172 0
|
Serverless Shell 对象存储
Guidelines for Function Compute Development - Crawler
The Guidelines for Function Compute Development - Use Fun Local for Local Running and Debugging briefly describes how to use Fun Local for the local running and debugging of functions.
1499 0