title: Assign the returned value of a function to a variable‎ in unix shell script
body: <p>I tried to print the value returned from testfunction. But it is not displaying anything . I used <code>./filename.sh</code> to execute the script. Please help</p>
  
  <pre><code>#!/bin/ksh
  testfunction()
  {
  
  k=5
  
  return $k
  
  }
  
  val=$(testfunction)
  
  echo  $val
  </code></pre>