I like the fact that on Mac OS X I can drag files into Apple's Terminal.app windows and have the path appear. Unfortunately there is no way to drag from the terminal. This program corrects this. It adds a new command that allows you to specify files to drag and opens a window with an icon for you to actually drag.
I usually use this if I want to open something in a Cocoa app. e.g. I want to email a tarball that I've just made. 'drag myTarball.tgz' and then drag the icon into a new email in Mail.app. You can also drag into the standard 'open file' dialog box.
Put Drag.app in your Applications directory. Modify the 'drag' shellscript to point to it. (In detail, replace "~/Applications/Drag.app" in that file with the path to Drag.app, and leave the rest alone.) Put the 'drag' shellscript somewhere in your path.
Note: Apparently the shell script isn't handling spaces correctly. Instead of the shell script, you can add the line alias drag=~/Applications/Drag.app/Contents/MacOS/Drag (with the appropriate path to where you put Drag.app) to your .bashrc or other login script of choice. If you do this then you don't need the 'drag' shell script at all and it will handle spaces correctly.
Note II: I have only compiled Drag.app for Intel based Macs. The source (simple as it is) is in the tarball. Compiling for powerpc is an exercise for the reader.
Type 'drag <filename> [<filename1> [<filename2> ... ]]' as a command in your shell. A window will then open with a big picture of a file in it (unfortunately Drag.app currently does not bring itself to the front - sigh). Drag the file whereever you want. By default the file will be moved to the new location if you drag to the finder. If you want to copy to the finder, hold down the Option key as you are dropping the file in the finder.
Once you release from the drag, the program will exit returning your shell. This happens whether the drag was successful or not (and so provides an easy way to cancel - simply drag the file a little, and drop it back inside Drag.app's window).
If you specify multiple files then all of them are considered part of the same drag. If you specify no files then nothing happens.
Apple's license for example code (on which this app is based) says the code is free for any use as long as you acknowledge that Apple wrote the code, and don't try to hold them responsible for your changes. I'm releasing under a similar license. Keep the acknowledgements in the source code in place. There are no warranties, express or implied. If you make any improvements, it would be nice if you would let me know (willu.sp@cse.unsw.edu.au) so that I can incorporate them in the original.
The code (and Intel mac binary) are here.