I'm trying to make a script that crawls through a giving directory and list all files that are x265. Using mediainfo and can see if the file is x264 or x265, I then use sed to clean up the text. The part that is eluding me is:
1.How do i phrase a command that works in cli but not here and
2.How do i get it to include subdirectories.
#!/bin/bash
for file in ls
search='mediainfo $file | grep -E "Writing library"| sed 's/.*x//'| sed 's/\s.*$//''
if [ $search -eq 265 ]
then
echo $file is a 265
else
echo $file is not 265 and is $search
fi