Understanding the exec 3<&0 Mechanism in Linux
One day, I suddenly wanted to implement a Redis client using Bash, adhering to the principle of <span>not reinventing the wheel</span>, and discovered an open-source library redi.sh[1]. As a client, it is essential to establish a TCP connection with the server. Driven by curiosity, I studied its source code: exec {FD}<> /dev/tcp/"$REDIS_HOST"/"$REDIS_PORT" As shown above, … Read more