To execute a command and return the result in a bash script to store in a variable, for example, you must write the inner command for the var = $ (command) command. And you should not specify spaces between var, '=' and $ (). Look at this
TEXT=$('cat configure.ac')
Now echo $TEXT
returns the contents of the configure.ac file.
source share