2013. 11. 12. 14:39
#!/bin/bash
function intro(){
echo "swap shell script!"
}
function swapNum(){
local tmp=$1
num1=$num2 #call by value
num2=$tmp
return 255 #return value is 1byte
}
intro
echo "begin num is $1, $2"
num1=$1
num2=$2
swapNum num1 num2 #call fucntion
echo "result is $?"//return value
echo "artificial num is $num1, $num2"
'Programming > Bash shell' 카테고리의 다른 글
check wheter mySQL is running in bash shell (0) | 2013.11.20 |
---|---|
check if mysql database exists in bash shell (0) | 2013.11.20 |
Using shell script to control in mySQL (0) | 2013.11.19 |
optional parameter expansions in bash shell (0) | 2013.11.19 |
Replace string in bash shell (0) | 2013.11.18 |