store command result in a variable - Shell

store cmd result

Snippet Code


  
Rate this page :
  [ 0 votes]

To store command result use the method mentioned.

val=`command to be executed` echo $val example: str= grep -c 'Example Code:' * val=`eval $str` echo $val

Tags


Ask Questions

Ask Question