Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

linux function return

function myfunc()
{
    local  myresult='some value'
    echo "$myresult"
}

result=$(myfunc)   # or result=`myfunc`
echo $result
Comment

linux function return

function myfunc()
{
    local  result=$1
    local  myresult='some value'
    eval $result="'$myresult'"
}

myfunc result
echo $result
Comment

PREVIOUS NEXT
Code Example
Shell :: pull environment variables with helm charts 
Shell :: cara lihat password mac 
Shell :: homebrew install nasm 
Shell :: alternative to the default mysql shell 
Shell :: master branch renamed 
Shell :: papermc no gui 
Shell :: install sftpclient 
Shell :: how to know branch from which add branch 
Shell :: bash ssh enable color 
Shell :: prepend xml to svg sed 
Shell :: update aur packages archlinux 
Shell :: leetcode even digits 
Shell :: How can I use Windows PowerShell to find the status of Hyper-V on my laptop running Windows 8.1? 
Shell :: change privilege in running container 
Shell :: Inspecting commands 
Shell :: wget health check 
Shell :: navigate to previous directory (DIR) 
Shell :: linux manjaro tg link 
Shell :: Navigate to previous directory in windows command prompt 
Shell :: npm global install without sudo 
Shell :: github status 
Shell :: remove ADS 
Shell :: how to save file in linux 
Shell :: windows command line connect to bluetooth device 
Shell :: sed add line to file 
Shell :: nano duplicate line or copy paste line 
Shell :: terminals for ubuntu 20.04 
Shell :: go mod donwload from github 
Shell :: see active apcahe conf file 
Shell :: install react router dom 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =