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

piping doesn't work for run_sh #1597

Closed
h4ck3rk3y opened this issue Oct 20, 2023 · 1 comment · Fixed by #1642
Closed

piping doesn't work for run_sh #1597

h4ck3rk3y opened this issue Oct 20, 2023 · 1 comment · Fixed by #1642
Assignees
Labels
bug Something isn't working cli For bugs relating to the CLI painful Painful bug

Comments

@h4ck3rk3y
Copy link
Contributor

What's your CLI version?

0.84.9

Description & steps to reproduce

run = "cat /foo/bar.txt | tr -d '\n'"

for a file that looks like

foo

still keeps the newline

Desired behavior

the new line gets dropped due to the pipe

What is the severity of this bug?

Painful; this is causing significant friction in my workflow.

What area of the product does this pertain to?

CLI: the Command Line Interface

@h4ck3rk3y h4ck3rk3y added the bug Something isn't working label Oct 20, 2023
@github-actions github-actions bot added cli For bugs relating to the CLI painful Painful bug labels Oct 20, 2023
@h4ck3rk3y
Copy link
Contributor Author

def run(plan):
  result = plan.run_sh(run="mkdir -p /src && echo kurtosis > /src/tech.txt", store=["/src/tech.txt"])
  file_artifacts = result.files_artifacts
  result2 = plan.run_sh(run="cat /temp/tech.txt", files={"/temp": file_artifacts[0]})
  plan.verify(result2.output, "==", "kurtosis\n")
  result2 = plan.run_sh(run="cat /temp/tech.txt | tr -d '\n'", files={"/temp": file_artifacts[0]})
  plan.verify(result2.output, "==", "kurtosis") # this should pass but fails

@h4ck3rk3y h4ck3rk3y self-assigned this Oct 27, 2023
@h4ck3rk3y h4ck3rk3y linked a pull request Oct 27, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli For bugs relating to the CLI painful Painful bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant