Assign the returned value of a function to a variable in unix shell script
This ksh functions works:
IPADDRESS() # get the IP address of this host{ # purpose: to get the IP address of this host # and return it as a character string # typeset -l IPADDR IPADDR=$(ifconfig -a | grep inet | grep -v '127.0.0.1' | awk '{print $2}') print $IPADDR}IP_Address=$(IPADDRESS)echo $IP_Addressexit