develog

[Linux] shell script, function return string 본문

OS & Shell/Linux

[Linux] shell script, function return string

냐옴 2015. 1. 9. 15:19

소스, test.sh

#/bin/bash

getStr(){
        eval "$1='abc str'"
}

getStr retVal
echo $retVal


실행결과, ./test.sh

abc str


Comments