Skip to content

Managing CD in a pipe. #17

Open
pabloabap wants to merge 1 commit intoshackbei:mainfrom
pabloabap:main
Open

Managing CD in a pipe. #17
pabloabap wants to merge 1 commit intoshackbei:mainfrom
pabloabap:main

Conversation

@pabloabap
Copy link

Thanks for share the exercise, very helpful!
Added a quick fix when cd is used in a pipe. Bellow some case of the program before the fix:

  1. ___ Microshell ___
    input > ./microshell cd . "|" /bin/wc
    output > nothing. Seems /bin/wc is waiting for input in the pipe.
    ___ Bash ___
    input > cd . | /bin/wc
    output > 0 0 0

  2. ___ Microshell ___
    input > ./microshell /bin/ls "|" cd . "|" /bin/wc
    output > 3 3 29 Seems /bin/wc count the output of /bin/ls
    ___ Bash ___
    input > /bin/ls | cd . | /bin/wc
    output > 0 0 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant