linux execute command in shell and assign result to variable

data=`df`

Just use backticks


$ var
$ var = {`df -lh | grip Filesystem`}


Verified as follows:
date=$(command)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326028469&siteId=291194637