Code to execute a command on another tty

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Code to execute a command on another tty

STeve Andre'
   I'm looking for a way to execute commands on other tty's.
On SunOS there was force.  Is there an equivelant here or do
I need to make my own?

Thanks, STeve Andre'

Reply | Threaded
Open this post in threaded view
|

Re: Code to execute a command on another tty

Lord Sporkton
As long as the permissions are correct you can just redirect, you just
need to know what tty your piping to, i used who to check, and you
have to be an equal or higher user, my example was done as the same
user on both sides, like so:

ttyp1:
$ echo hello world > /dev/ttyp0
$

ttyp0
$ hello world




On 7/24/06, STeve Andre' <[hidden email]> wrote:
>    I'm looking for a way to execute commands on other tty's.
> On SunOS there was force.  Is there an equivelant here or do
> I need to make my own?
>
> Thanks, STeve Andre'
>
>


--
-Lawrence

Reply | Threaded
Open this post in threaded view
|

Re: Code to execute a command on another tty

STeve Andre'
That echoes data to another tty; I want to send *input* to that
ttty as if somewhere were there.  

--STeve Andre'

On Tuesday 25 July 2006 07:11, Lawrence Horvath wrote:

> As long as the permissions are correct you can just redirect, you just
> need to know what tty your piping to, i used who to check, and you
> have to be an equal or higher user, my example was done as the same
> user on both sides, like so:
>
> ttyp1:
> $ echo hello world > /dev/ttyp0
> $
>
> ttyp0
> $ hello world
>
> On 7/24/06, STeve Andre' <[hidden email]> wrote:
> >    I'm looking for a way to execute commands on other tty's.
> > On SunOS there was force.  Is there an equivelant here or do
> > I need to make my own?
> >
> > Thanks, STeve Andre'

Reply | Threaded
Open this post in threaded view
|

Re: Code to execute a command on another tty

Jeff Quast
In reply to this post by Lord Sporkton
> On 7/24/06, STeve Andre' <[hidden email]> wrote:
> >    I'm looking for a way to execute commands on other tty's.
> > On SunOS there was force.  Is there an equivelant here or do
> > I need to make my own?

On 7/25/06, Lawrence Horvath <[hidden email]> wrote:

> As long as the permissions are correct you can just redirect, you just
> need to know what tty your piping to, i used who to check, and you
> have to be an equal or higher user, my example was done as the same
> user on both sides, like so:
>
> ttyp1:
> $ echo hello world > /dev/ttyp0
> $
>
> ttyp0
> $ hello world

I think STeve means otherwise, as to force that user's tty to give
input to the command shell or force them to do an exec(). In this
example, ttyp1 is doing the actual exec, and redirecting the output to
ttyp0.

I don't know of any methods myself to force a user to do an exec() on
a specific terminal. I think this would require some help in the
kernel, or software on both terminals such as 'screen'.

Reply | Threaded
Open this post in threaded view
|

Re: Code to execute a command on another tty

Lord Sporkton
oh, actaully executing it in the other shell, not just outputting it
to another terminal, yea thats trickier, havent been able to get that
done, though i was working on it a while, did get to far, i guess you
could direct input to the other shell? possible? almost to simulate
having input the command at the other shell, idk how exactly though

On 7/25/06, Jeff Quast <[hidden email]> wrote:

> > On 7/24/06, STeve Andre' <[hidden email]> wrote:
> > >    I'm looking for a way to execute commands on other tty's.
> > > On SunOS there was force.  Is there an equivelant here or do
> > > I need to make my own?
>
> On 7/25/06, Lawrence Horvath <[hidden email]> wrote:
> > As long as the permissions are correct you can just redirect, you just
> > need to know what tty your piping to, i used who to check, and you
> > have to be an equal or higher user, my example was done as the same
> > user on both sides, like so:
> >
> > ttyp1:
> > $ echo hello world > /dev/ttyp0
> > $
> >
> > ttyp0
> > $ hello world
>
> I think STeve means otherwise, as to force that user's tty to give
> input to the command shell or force them to do an exec(). In this
> example, ttyp1 is doing the actual exec, and redirecting the output to
> ttyp0.
>
> I don't know of any methods myself to force a user to do an exec() on
> a specific terminal. I think this would require some help in the
> kernel, or software on both terminals such as 'screen'.
>
>


--
-Lawrence

Reply | Threaded
Open this post in threaded view
|

Re: Code to execute a command on another tty

Mike Hernandez-3
On Jul 25, 2006, at 9:55 AM, Lawrence Horvath wrote:

> oh, actaully executing it in the other shell, not just outputting it
> to another terminal, yea thats trickier, havent been able to get that
> done, though i was working on it a while, did get to far, i guess you
> could direct input to the other shell? possible? almost to simulate
> having input the command at the other shell, idk how exactly though

If you use screen you can just start a session on the terminal that  
you want to execute on and connect to it from any other machine that  
has access to that machine. It works on terminals on the same machine  
as well. Multiple users can attach to one session, it can make for  
some interesting vim sessions ;)

Mike

Reply | Threaded
Open this post in threaded view
|

Re: Code to execute a command on another tty

chris barry
In reply to this post by STeve Andre'
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> On Behalf Of STeve Andre'
> Sent: Tuesday, July 25, 2006 9:35 AM
> To: [hidden email]
> Subject: Re: Code to execute a command on another tty
>
> That echoes data to another tty; I want to send *input* to that
> ttty as if somewhere were there.  
>
> --STeve Andre'
>
> On Tuesday 25 July 2006 07:11, Lawrence Horvath wrote:
> > As long as the permissions are correct you can just
> redirect, you just
> > need to know what tty your piping to, i used who to check, and you
> > have to be an equal or higher user, my example was done as the same
> > user on both sides, like so:
> >
> > ttyp1:
> > $ echo hello world > /dev/ttyp0
> > $
> >
> > ttyp0
> > $ hello world
> >
> > On 7/24/06, STeve Andre' <[hidden email]> wrote:
> > >    I'm looking for a way to execute commands on other tty's.
> > > On SunOS there was force.  Is there an equivelant here or do
> > > I need to make my own?
> > >
> > > Thanks, STeve Andre'
>
>


Would www.conserver.com work for you?

-C

Reply | Threaded
Open this post in threaded view
|

Re: Code to execute a command on another tty

Michael Coulter
In reply to this post by STeve Andre'
On Mon, Jul 24, 2006 at 08:36:29PM -0400, STeve Andre' wrote:
>    I'm looking for a way to execute commands on other tty's.
> On SunOS there was force.  Is there an equivelant here or do
> I need to make my own?

In tty(4), have at look a TIOCSTI.

Reply | Threaded
Open this post in threaded view
|

Re: Code to execute a command on another tty

STeve Andre'
On Tuesday 25 July 2006 13:20, Michael Coulter wrote:
> On Mon, Jul 24, 2006 at 08:36:29PM -0400, STeve Andre' wrote:
> >    I'm looking for a way to execute commands on other tty's.
> > On SunOS there was force.  Is there an equivelant here or do
> > I need to make my own?
>
> In tty(4), have at look a TIOCSTI.

Yeah, I knew about that, and since there doesn't seem to be
a force program, I just wrote one.  Thanks all...

--STeve Andre'