Home > Net >  File path that modified by concatenating variables not working
File path that modified by concatenating variables not working

Time:04-23

I'm trying to make this work. Please help.

folder="Test\ Folder"
path="/Volumes/Macintosh\ HD/Users/Shared/${folder}"
echo "$path"
if [ -d "$path" ]; then
echo "Yes"; else echo "No"
fi

This is the original script I'm working on.

echo in point
read inp
echo out point
read op
echo path
read ffolder

fName=`echo "$ffolder" | cut -d'/' -f1`

makejpgs () {
        ffmpeg -y -i "${3}" -ss $1 -to $2 -vf fps=12 "$fName_%d.jpg"
}

path="/Volumes/PROJECTS/Main/${fName}"
files=$(find "$path" -type f -name "*story*")
echo "$files"

for i in $files; do

    echo "$i"
    makejpgs "$inp" "$op" "$i"

done

ffmpeg giving error when not using \ .

CodePudding user response:

If you have a value "between quotes", then you do not need to escape\ spaces. So, change each \ into just .

  • Related