Recover location of script that is automatically executed after DnD: file -> terminal
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Recover location of script that is automatically executed after DnD: file -> terminal
Hi guys,
I am facing a problem that I did not cause and at a computer that I do not have direct access to. Basically, I am trying to help a linux newbie (Mrs A) to recover a customized conversion script that works perfectly on a computer of a friend (Mr B) of hers. So imagine at this friends (Mr B) computer they just have to drag and drop a file into the terminal and press return. This executes the appropriate script and writes out the converted file in a standard location. This setting was done by a third friend of Mrs A and Mr B, who I dont know and who apparently knows something about linux (he was also doing the customization of the script. I think he just tried ease the use of this script as much as possible. But in the same way he obscured the location of the script, so that Mr B was not able to give the script to Mrs A).
Next week Mrs A and Mr B will meet and try to recover the location of the script Mr B is using. But I wont be there, so I cannot try to fix it by trial and error.
So my question is now, given an existing link between a file extension (I think thats what it is) and a script in a terminal, how do I/they recover the location of the script?. This is not an hacking exercise. I just want to give Mrs A a recipe that allows both of them with (local/direct) access to the computer to recover the location of the script and copy it.
If it is terminal or distribution specific, then I would say Mr B uses Ubuntu and the standard terminal of it. But if there is a generic solution, I would prefer it, since I am not sure what he is using.
Thank you for your help,
Nothing Special
Last edited by NothingSpecial; 05-19-2012 at 09:07 AM.
"drag and drop a file into the terminal" is intriguing. Doing so using urxvt has no effect. Doing so using Xfce's Terminal simply writes the singly quoted name of the file at the command prompt.
What is the effect of doing so with whatever terminal emulator Mr B uses? Does Mr B have to press Enter after doing so or does something happen immediately? Which terminal emulator does Mr B use?
Thanks for your suggestions and sorry for the delay from my side. I am not able to try anything at Mr Bs computer, because its in another country. But the drag and drop effect I saw on my friends terminal (so Mrs A) was that it copies the file location into the terminal. It looks somehow similar to
Code:
file:///home/user/folder/filename.obj
(.obj is in this case the filename extension -- A wavefront 3D object file, which is basically an ordinary textfile in a certain format)
So if you press enter you basically just send a path of a file and the terminal executes a standard command. Most probably similar as opening any file in the disk browser, which calls the standard program with the path of the file.
Cheers,
Nothing Special
PS I know that Linux usually does not care about file extensions, but the .obj files do not have any #!/bin/bash or similar
Is Mrs A using the same terminal emulator as Mr B?
Dragging from Xfce's file manager, Thunar, into Xfce's terminal emulator, Terminal, the full path of the dragged file is written at the command prompt but there is no file:/ prefix. The full path is single quoted if necessary; any quotes are rendered as \' outside the quotes).
When enter/return is pressed it is the shell that takes whatever is typed at the command prompt, processes it and executes any remaining command (if the shell is bash, the processing is in accordance with shell operation).
What sort of files is Mr B dragging into whichever terminal emulator he is using and which shell is he running?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.