Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single pipe | #42

Closed
Tracked by #2
superxcgm opened this issue Sep 8, 2021 · 4 comments
Closed
Tracked by #2

Single pipe | #42

superxcgm opened this issue Sep 8, 2021 · 4 comments
Assignees

Comments

@superxcgm
Copy link
Owner

superxcgm commented Sep 8, 2021

Epic

Process

Description

For good user experience, user can add chain commands using pipeline

AC

Given: User type some_command (For example: echo ab)
When: User hit
Then: Print ab on console.

Given: User type some_command | another_command (For example:ls -l | grep 'hello' )
When: User hit
Then: Should use output of first command as input of second command.

Out of Scope

Support of multi pipe, like command1 | command2 | command3

@superxcgm superxcgm mentioned this issue Sep 8, 2021
32 tasks
@superxcgm superxcgm changed the title Support single pipe | Single pipe | Sep 11, 2021
@superxcgm superxcgm self-assigned this Sep 18, 2021
@superxcgm superxcgm assigned lq1149622825 and unassigned superxcgm Sep 18, 2021
@lq1149622825
Copy link
Contributor

Technical knowledge used

  1. fork() multi-process programming
  2. pipe principle
  3. Redirection principle

tsaking

  1. Split the command to get the set of command_parse_result;
  2. Get the set of command_pase_result, and get the part that needs "|" for processing according to the size
  3. Create two child processes. Colleagues process two commands, and write the output of the first command to the pipeline at the same time, and the second line of commands is processed from the read data
  4. refactor

@lq1149622825
Copy link
Contributor

lq1149622825 commented Sep 22, 2021

9月22日

redirection bug

  • such as user input "> a.txt || < a.txt" , program error

single Pipe line progress

  • Steps 1 to 3 are basically completed, there is a problem with pipeline redirection, which needs to be resolved(solved today)

Unresolved problem

  • build_in alias have bug,such as user input "alias ll = 'ls -lh'",or input "alias",program have no output

@lq1149622825
Copy link
Contributor

9月23日

redirection bug

  • such as user input "> a.txt || < a.txt" , program error
  • such as user input "alias" , program having nothing print

single Pipe line progress

  • solve the build_in command pipe line(build_in alias have bug,such as user input "alias ll = 'ls -lh'",or input "alias",program have no output)

mutil Pipe line progress

  • do the tasking with mutil pipe card;

superxcgm added a commit that referenced this issue Sep 24, 2021
Single pipe | Redierct
@superxcgm
Copy link
Owner Author

QA

Given: User type some_command (For example: echo ab)
When: User hit
Then: ✅Print ab on console.

Given: User type some_command | another_command (For example:ls -l | grep 'hello' )
When: User hit
Then: ✅Should use output of first command as input of second command.

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

No branches or pull requests

2 participants