Article 5GCR9 [SOLVED] Save output of command to a variable

[SOLVED] Save output of command to a variable

by
GPGAgent
from LinuxQuestions.org on (#5GCR9)
I have a script to display the video name and it's height.Code:$ for ff in *.mp4; do echo "$ff"; mediainfo --Inform="Video;%Height%" "$ff"; echo "============";done
What I would like to do is to pipe this to a file if the height is 720 or more, but I can't quite get how to do this.

I need to check the result of Code:mediainfo --Inform="Video;%Height%" "$ff"where ff is the video file being processed by mediainfo

Obviously Code:mediainfo --Inform="Video;%Height%" test.mp4 > Hjust creates a file H with 720 in it.

I don't know how to assign the result of the mediainfo command to a variable I can check inside the script with an if construct.

It's probably obvious but not to me!latest?d=yIl2AUoC8zA latest?i=PYOXMu4jHzI:OyTMBsEZo9k:F7zBnMy latest?i=PYOXMu4jHzI:OyTMBsEZo9k:V_sGLiP latest?d=qj6IDK7rITs latest?i=PYOXMu4jHzI:OyTMBsEZo9k:gIN9vFwPYOXMu4jHzI
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments