This is bash script which prints framerate of a video and the argument it takes may contain spaces. also this argument is going to be used in a command inside the script.
#!/bin/bash
inputVid="$*"
#checking if $inputVid has full path
echo $inputVid
frames=`ffmpeg -i $inputVid 2>&1 | sed -n "s/.*, \(.*\) fp.*/\1/p"`
echo $frames
when I execute
$./frameRate.sh ../Downloads/FlareGet/Videos/Why\ .mp4
output is:
../Downloads/FlareGet/Videos/Why .mp4
so the filename is getting passed correctly but spaces are not getting escaped hence no output from ffmpeg
is there any way to solve this ?