Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Pipes vs I/O redirection  (Read 86487 times)

0 Members and 1 Guest are viewing this topic.

Alvin Seville

    Topic Starter


    Newbie

    • Experience: Beginner
    • OS: Mac OS
    Pipes vs I/O redirection
    « on: November 11, 2020, 10:28:51 PM »
    Hello! Can somebody tell my why first code works as expected:

    Code: [Select]
    echo 1 | { read x; echo $x; }
    and the second one doesn't:

    Code: [Select]
    echo 1 >&0; read x; echo $x;
    ? I expect 1 outputted but in second case I have to press return before it.

    - Best regards, Alvin Seville.