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

stdin redirect #598

Open
drawadiagram opened this issue Dec 14, 2021 · 0 comments
Open

stdin redirect #598

drawadiagram opened this issue Dec 14, 2021 · 0 comments

Comments

@drawadiagram
Copy link

Description

Add function by which the user can redirect stdin from a file.

Motivating Example

Redirect for stdin is a common use case when manipulating shell programs that require interactive input. The MD engine Gromacs has several analytical programs which require interactive input, e.g. gmx energy.

When calling gmx energy with an appropriate energy file *.edr, the user is prompted to select which variable should be calculated (e.g. potential energy) from a numerated list (e.g. user inputs "16 0"). In this example, the user input could be stored in a file, allowing programmatic use of the gmx energy executable and its relevant outputs.

Recommended workaround

Per conversation with @andre-merzky, there is a workaround where the shell itself (/bin/sh) is named as the executable, and the input variables include the functional and desired redirects (gmx energy -f energy.edr < input.txt). This approach may not be portable to all use cases.

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

1 participant