How do I remap stdin/stdout? (like screen)

How do I remap stdin/stdout? (like screen)

Post by ChangKyu Son » Tue, 25 Mar 1997 04:00:00



Hello. I am not asking about redirecting.
 I am finding a way to remap stdin/stdout in program executing. like
screen... It can make virtual windows and emulate executing program in
each window.
 For another example, think of changing password by a user program. A
user can change his own password with passwd, the setuided program. We
are to run passwd program and change password without any typing. I
think it is possible. I can make program which does almost same with
TCP/IP connection(to automatically login, and run password, and change)
but I am not saying about that...
 Sorry for my poor english. And Thank you

 
 
 

How do I remap stdin/stdout? (like screen)

Post by Andrew Giert » Wed, 26 Mar 1997 04:00:00


 ChangKyu> Hello. I am not asking about redirecting.
 ChangKyu> I am finding a way to remap stdin/stdout in program
 ChangKyu> executing. like screen... It can make virtual windows and
 ChangKyu> emulate executing program in each window.

Screen does this with ptys.

 ChangKyu> For another example, think of changing password by a user
 ChangKyu> program. A user can change his own password with passwd,
 ChangKyu> the setuided program. We are to run passwd program and
 ChangKyu> change password without any typing. I think it is possible.

This also needs ptys; look for the "expect" utility, which is good at
this sort of thing.

--
Andrew.

comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>

 
 
 

How do I remap stdin/stdout? (like screen)

Post by ChangKyu Son » Thu, 27 Mar 1997 04:00:00


Hello. I am not asking about redirecting.
 I am finding a way to remap stdin/stdout in program executing. like
screen... It can make virtual windows and emulate executing program in
each window.
 For another example, think of changing password by a user program. A
user can change his own password with passwd, the setuided program. We
are to run passwd program and change password without any typing. I
think it is possible. I can make program which does almost same with
TCP/IP connection(to automatically login, and run password, and change)
but I am not saying about that...
 Sorry for my poor english. And Thank you

 
 
 

How do I remap stdin/stdout? (like screen)

Post by Vikas Dewa » Thu, 27 Mar 1997 04:00:00



> Hello. I am not asking about redirecting.
>  I am finding a way to remap stdin/stdout in program executing. like
> screen... It can make virtual windows and emulate executing program in
> each window.
>  For another example, think of changing password by a user program. A
> user can change his own password with passwd, the setuided program. We
> are to run passwd program and change password without any typing. I
> think it is possible. I can make program which does almost same with
> TCP/IP connection(to automatically login, and run password, and change)
> but I am not saying about that...
>  Sorry for my poor english. And Thank you

Look at:
getpwent(3), getpwnam(3), getpwuid(3), setpassent(3), setpwent(3),
endpwent(3)

Vikas Dewan

 
 
 

How do I remap stdin/stdout? (like screen)

Post by B.A.McCau.. » Fri, 28 Mar 1997 04:00:00



> I am finding a way to remap stdin/stdout in program executing. like
>screen... It can make virtual windows and emulate executing program in
>each window.
> For another example, think of changing password by a user program. A
>user can change his own password with passwd, the setuided program. We
>are to run passwd program and change password without any typing. I
>think it is possible. I can make program which does almost same with
>TCP/IP connection(to automatically login, and run password, and change)
>but I am not saying about that...
> Sorry for my poor english. And Thank you

You want "expect".

--

 .  _\\__[oo       from       | Phones: +44 121 471 3789 (home)

.  l___\\    /~~) /~~[  /   [ | PGP-fp: D7 03 2A 4B D8 3A 05 37...
 # ll  l\\  ~~~~ ~   ~ ~    ~ | http://wcl-l.bham.ac.uk/~bam/

 
 
 

1. sockets dup()ed to stdin and stdout of a process

   I am posting this for a friend of mine who doesn't have access

   Is it possible to use dup() to assign a socket to be the input
*and* the output of a process? I did this (to a process which uses the
stdio functions like gets(), etc.), in the hopes of then using
select() in another program to know when this process wants to read
and when it wants to write. The reading works fine, especially when
the other process does no input. If the other process does read()s, it
works also. But if it uses gets(), it doesn't work (it hangs, etc.).
select() also thinks the connection is writable, even though the stuff
that the other process printf()ed before it issued the gets() hasn't
been seen on the other end yet. My question is: what am I missing?
What should I know about the stdio functions when they've been dup()ed
to a socket? What is the right way to write EOF to such a process?
Will this work, in general, or do I need two separate sockets, one for
input and one for output?  Any help will be greatly appreciated.


2. Archive Backup Drive 21247

3. Controlling forked processes stdin/stdout

4. .config archive available?

5. Using separate window child process for stdin/stdout

6. Spreadsheets under Unix/X

7. Controlling stdin and stdouts of other executables

8. Help on anonymous ftp

9. Set stdin/stdout in binary on UNIX

10. Redirecting stdout/stdin to socket

11. redirect terminal stdin/stdout

12. Temporary stdin/stdout redirection

13. Strange behaviour on stdin/stdout filter