E
E
ElvisP2021-01-12 17:28:41
bash
ElvisP, 2021-01-12 17:28:41

How to make a script for macos terminal?

Hello good people!
I don’t understand anything in programming, but I understand what can be done in a couple of lines. I ask for your help.
I have a terminal command:

ffmpeg -i /out.mp4 -s 600x338 -an -c:a copy resize-nosound.mp4

I have to change the path to the out.mp4 file every time in the terminal, and so on a thousand times. Help drive out.mp4 into a variable and make a script file out of it.
I want to drag a file from the finder to this script and so that the variable takes the value = path to the file along with the file and the script is executed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AVKor, 2021-01-12
@ElvisP

The path can be passed as an argument: script.sh /path/to/out.mp4, but in script.shlike this:

#!/usr/bin/env bash

ffmpeg -i "$1" -s 600x338 -an -c:a copy resize-nosound.mp4

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question