阅读背景:

linux shell 学习(九)——函数基本使用

来源:互联网 

linux shell 学习(九)——函数基本使用

下面是代码:
#!/bin/bash

function func1 {
        echo "

linux shell 学习(九)——函数基本使用

下面是代码:
#!/bin/bash

function func1 {
        echo "$1 and $2"
}

value=`func1 $1 $2`
echo "$value"

temp=12
function func2 {
        local temp=23;
        echo "$temp"
}

func2
echo "$temp"


运行结果:


and " } value=`func1

linux shell 学习(九)——函数基本使用

下面是代码:
#!/bin/bash

function func1 {
        echo "$1 and $2"
}

value=`func1 $1 $2`
echo "$value"

temp=12
function func2 {
        local temp=23;
        echo "$temp"
}

func2
echo "$temp"


运行结果:


` echo "$value" temp=12 function func2 { local temp=23; echo "$temp" } func2 echo "$temp" #



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: