Article 4RW66 Determining the filepath and filename for the file a bash script was run on from the RMB menu

Determining the filepath and filename for the file a bash script was run on from the RMB menu

by
underscoreus
from LinuxQuestions.org on (#4RW66)
Hello!
I don't know if this question is outside the scope of this forum as it is more a bash specific question and not expressly (and exclusively) Linux related but since I had such a great response last time I figured I'd dip my toe in again and try to ask.

So, the title might be kind of confusing and weirdly spelled out so here is a step by step of what I am trying to do/looking for:

- Creating a script and adding it to the right click menu inside the file explorer.
- When I right click a file and selects this script it has to somehow be able to figure out what file it has been "called from" since its going to be executing functions on said file, like renaming etc.

What would be they way to do this/what would the terminology for this be?
I've had a look on google but as my title might make apparent is that I have no idea what this is called and searching for stuff like my title does not give a conclusive result.

Thanks for the read!latest?d=yIl2AUoC8zA latest?i=jB_nVxU6r0g:A2YBOHtF2IA:F7zBnMy latest?i=jB_nVxU6r0g:A2YBOHtF2IA:V_sGLiP latest?d=qj6IDK7rITs latest?i=jB_nVxU6r0g:A2YBOHtF2IA:gIN9vFwjB_nVxU6r0g
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments