bash - Auxiliary piping for shell input output redirection -


in script need output special commands pre-defined file descriptor along usual stdout-stderr , listen commands in program without creating file.

essentially it's redirection pipe, roundabout through using other file descriptor(s) or socket or device:

usual way redirecting stdout(1) stdin(0):

> program1 | program2 

what need (some redirection, uses other descriptor e.g. 5):

> exec "open descr 5 <>5"  > program1 ??5?? & program2 <5 & 

program1 "knows" descriptor number 5 , outputs fwrite(5, ...), program2 uses usual stdin redrection.

how can roundabout redirection in shell?

you can't. way semaphore use fifo file, you've said don't want make file. file descriptors define, exist in shell, subprocess or program unaware of them.


Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -