PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > Starting programs with mutually interconnected stdin/stdout
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

Starting programs with mutually interconnected stdin/stdout

Réponse
 
LinkBack Outils de la discussion
Vieux 21/08/2006, 20h42   #1
AlesD
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Starting programs with mutually interconnected stdin/stdout

Hello,

is there way to start programs foo and bar such that foo's stdout
goes to bar stdin and bar's stdout goes to stdin?

Or to make program's stdin/out TCPIP socket?

Ales
  Réponse avec citation
Vieux 21/08/2006, 21h00   #2
Matej Cepl
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Starting programs with mutually interconnected stdin/stdout

AlesD wrote:
> is there way to start programs foo and bar such that foo's stdout
> goes to bar stdin and bar's stdout goes to stdin?


I think with a little bit playing with mkfifo you can achieve this.

Matěj

--
GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC
http://www.ceplovi.cz/matej/blog/, Jabber: ceplma@jabber.cz
23 Marion St. #3, (617) 876-1259, ICQ 132822213

In political activity men sail a boundless and bottomless sea;
there is neither harbor for shelter nor floor for anchorage,
neither starting point nor appointed destination.
-- Michael Oakeshott: Rationalism in Politics

  Réponse avec citation
Vieux 21/08/2006, 21h56   #3
John DuBois
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Starting programs with mutually interconnected stdin/stdout

In article <ecd0pv$f0s$1@mrazik2.dkm.cz>, AlesD <ales_d@seznam.cz> wrote:
> is there way to start programs foo and bar such that foo's stdout
>goes to bar stdin and bar's stdout goes to stdin?


In ksh:

foo |&

bar <&p >&p

John
--
John DuBois spcecdt@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/
  Réponse avec citation
Vieux 22/08/2006, 09h12   #4
Stephane Chazelas
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Starting programs with mutually interconnected stdin/stdout

On Mon, 21 Aug 2006 20:56:04 -0000, John DuBois wrote:
> In article <ecd0pv$f0s$1@mrazik2.dkm.cz>, AlesD <ales_d@seznam.cz> wrote:
>> is there way to start programs foo and bar such that foo's stdout
>>goes to bar stdin and bar's stdout goes to stdin?

>
> In ksh:
>
> foo |&
>
> bar <&p >&p

[...]

And in zsh:

coproc foo
bar <&p >&p

|& in zsh is the same as in csh/tcsh: pipe both stdout and
stderr in foo |& bar.

Portable solution is to use named pipes:

mkfifo other-way-round
foo < other-way-round | bar > other-way-round

Beware of deadlocks

--
Stephane
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 23h01.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 1,88212 seconds with 12 queries