Re: [gedit-list] send selected text to terminal

At 15:12 -0800 2/11/08, Syed Abid Hussaini wrote:
>  I am new to linux and have a very basic question.
>How do a send a selected text to the terminal such that it is executed.
>For example typing, "sudo apt-get update" in gedit text editor and select and use some shortcut to
>send this to terminal.
>I am trying to understand the external tool thing and managed to send some selected text using
>xargs to the below output region. How do i send something to terminal?

>From an earlier posting of mine on Fri, 8 Feb 2008 19:54:47 -0700:

I once made tcsh run a command with nothing but "tcsh -s"  in the text of the tool while calling for input from the selection and output to the bottom pane. But after a restart it doesn't work anymore. Maybe it never did. We added some server features and an ftp daemon.

I now find that does work but one has to be very careful to include the line end after the selection.

Also. . . . .

See the man page for xargs to learn about replacing symbols in a command.
man xargs
in Terminal.

At 12:18 -0500 2/7/08, Dave (My-IOP) provided a sample using xargs
1. selected the external tools plugin in gedit
2. Defined a new tool with these values:

name: "Launch in browser"
description: Open selected URL in browser
shortcut key: <Control>semicolon (or anything you wish)
command: xargs -I '{}' gnome-open '{}'
input: current selection
output: display in bottom pane
Applicability: local files only

And. . .
Use of shell commands from gedit needs work. I really want underlying shell commands to be executable by select and ENTER with persistent environment variables that stay around for the life of a gedit session. Yes. I have downloaded the source but it's slow going.

--> From the U S of A, the only socialist country that refuses to admit it. <--

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]