Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'How to implement drag-drop from unix' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How to implement drag-drop from unix
Authored by: rahulbenegal on Jul 22, '08 04:59:35AM

Is there a way of passing the output to an application, just as drag-drop would do ?

One option was the "open" command, but in some apps "open" does not behave like a drag drop would.

Thanks.



[ Reply to This | # ]
How to implement drag-drop from unix
Authored by: mario_grgic on Sep 03, '08 03:07:19PM

Yes of course there is. The standard UNIX way is command substitution. For example:

find . -name "*.java"

finds all java files in the current directory. So what if you want to open these files in vi? Well do command substitution

vi $(find . -name "*.java")

This first runs the command in $(...) and then passes the output of that as arguments to vi, which in turn opens the files found for editing (all of them at once).

Of course, sometimes it is better to just pipe output of one command to another with |



[ Reply to This | # ]