Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!


Click here to return to the 'How to implement drag-drop from unix' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
How to implement drag-drop from unix
Authored by: rahulbenegal on Tue, Jul 22 2008 at 4:59AM PDT
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 Wed, Sep 3 2008 at 3:07PM PDT
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 | # ]