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

Support accessing subprocess stdin/out as file #42

Open
pothos opened this issue Jun 7, 2022 · 3 comments
Open

Support accessing subprocess stdin/out as file #42

pothos opened this issue Jun 7, 2022 · 3 comments

Comments

@pothos
Copy link

pothos commented Jun 7, 2022

Bash supports getting the FD of an opened pipe directly in the form /dev/fd/X which then can be used as file path by the spawned process.

Expected:

$ head <(echo a) <(echo b)
==> /dev/fd/63 <==
a

==> /dev/fd/62 <==
b

Got:

$ head <(echo a) <(echo b)
head: <echo: No such file or directory
head: a: No such file or directory
head: <echo: No such file or directory
head: b: No such file or directory

Same for >(CMD) which will use stdin instead of stdout.

@mitnk
Copy link
Owner

mitnk commented Jun 12, 2022

Thanks @pothos. I never use this feature in my limited use of Bash. I checked a bit and found it only useful in some cases, and it's not part of POSIX. So I'm not find the necessary of adding it to cicada.

Do you feel you depend on this feature very much when you're using a shell?

@pothos
Copy link
Author

pothos commented Jun 12, 2022

Since bash is the de-facto standard for a shell, I simply expected it to work ;) I use it from time to time as its quite useful for things like diff <(cmd1) <(cmd2) but mostly when I'm testing single parts of a script.
Fyi, it's also supported by https://github.com/nuta/nsh

@mitnk
Copy link
Owner

mitnk commented Jun 12, 2022

Let's put this to to-do-list then. I just know nsh, which I saw it support input colors, which I always want to have in cicada haha!

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

No branches or pull requests

2 participants