Shell script problems.

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Shell script problems. Tue Dec 15, 2015 9:40 pm • by Zang
Does anyone know what's going wrong here? I have a workflow that moves files to a NAS for my Kodi box. Unfortunately, the Kodi box (like many things) doesn't play h.265 well. And so I have a rule set up to separate out h.265 files out, and convert them automatically to h.264 using Handbrake CLI.

The rule is as follows:

Comment - does not contain - handbraked (just using this to mark files as converted)
Passes Shell Script - [below]
Code: Select all
if ffprobe `$1` 2> | grep 'Video: hevc'; then
       exit 0
else
   exit 1
fi


Unless I've written this wrong, grep is supposed to search the output of ffprobe for "Video: hevc" and pass the script if it finds it. But it's not finding it. Any and all files fail to pass and just move on to the next rules.
Zang
 
Posts: 1
Joined: Tue May 01, 2012 7:29 pm

Re: Shell script problems. Wed Dec 16, 2015 11:41 am • by Mr_Noodle
Not sure if this is the best forum for general shell script help. The only thing off the top of my head that might be the issue is if the program is outputting to standard error instead of standard out (the latter is what grep would use).
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support