Create an executable bash script that accepts drag and drop

I compiled mplayer from a source on Ubuntu. I did not want to use the graphical interface, but I wanted to create a bash executable that gets the path from the file that gets into the bash file. How can i do this?

I wanted it to look something like this: mplayer <get full path to file . file-ending>

I want the bash executable to be on my desktop;)


If possible, I just need the function rightclick -> start with mplayer , but I don't know how to do this.

+6
source share
1 answer

Try:

 #!/bin/bash mplayer "$1" 

The path to the file of the dumped file will be transferred to the script file as the 1st command line argument.

+4
source

Source: https://habr.com/ru/post/914598/


All Articles