简体   繁体   中英

Redirect both stdin and stdout in bash to different files

I need to make some bash script that stores all its input to file/pipe and reads its output from other file pipe and run forever. First part is like cat - > pipein and second is like cat pipeout . But how to make both parts simultaneously?

I also tried to mess with additional file descriptors but with no success.

Found an answer!

#!/bin/bash
cat pin &
cat >pout
wait

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM