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

Header script doesn't work when being piped or run with process substitution #671

Open
2 tasks done
bryant1410 opened this issue May 8, 2023 · 3 comments
Open
2 tasks done
Labels
stale::recovered [bot] recovered after being marked as stale type::bug describes erroneous operation, use severity::* to classify the type

Comments

@bryant1410
Copy link

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

The script doesn't work when being piped or run with process substitution. This causes the following to fail:

curl -fsSL https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh | bash

And:

bash <(curl -fsSL https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh)

The following lines cause the issue:

if ! echo "$0" | grep '\.sh$' > /dev/null; then
printf 'Please run using "bash"/"dash"/"sh"/"zsh", but not "." or "source".\n' >&2
return 1
fi

Conda Info

No response

Conda Config

No response

Conda list

No response

Additional Context

Related to conda/conda#12477

@bryant1410 bryant1410 added the type::bug describes erroneous operation, use severity::* to classify the type label May 8, 2023
@jaimergp
Copy link
Contributor

I think the intent here was to prevent source from being used. I am not sure if piping was supposed to be prevented too. Some might say it's a bad practice and it should be discouraged...

Pinging @conda/constructor for their opinion too.

Copy link

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    - What OS and version you reproduced the issue on
    - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label May 11, 2024
@bryant1410
Copy link
Author

Hey, please don't let this issue die!

@github-actions github-actions bot added stale::recovered [bot] recovered after being marked as stale and removed stale [bot] marked as stale due to inactivity labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale::recovered [bot] recovered after being marked as stale type::bug describes erroneous operation, use severity::* to classify the type
Projects
None yet
Development

No branches or pull requests

2 participants