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 the configuration of a shell environment before tracing a passed command #279

Open
elfring opened this issue Oct 4, 2021 · 10 comments

Comments

@elfring
Copy link

elfring commented Oct 4, 2021

The tool “guider” supports tracing (or profiling) for passed commands.
These commands are directly executed so far.
But this execution configuration should be adjusted for some use cases.

We are used to functionality which is provided by some command-line interpreters.
We would occasionally like to redirect data streams before a specified command will be executed.
How should the corresponding shell be constructed (without extra tracing) so that the desired data processing will be continued as expected? 🤔

@iipeace
Copy link
Owner

iipeace commented Oct 4, 2021

could you share more detailed examples?
As I understand, You wanna control stdout stream for target task created by guider. isn't it?

@elfring
Copy link
Author

elfring commented Oct 4, 2021

I would like to specify special files for the standard data streams of my test programs so that the output will be separated from data by your analysis tool for further software test runs.
I hope that I can avoid to construct additional shell scripts for data redirection purposes.

@iipeace
Copy link
Owner

iipeace commented Oct 4, 2021

Do you want to redirect stdout of specific program to specific file such a below example?

# guider btrace "ls -lha > ./output"

@elfring
Copy link
Author

elfring commented Oct 4, 2021

Yes (in principle)

Data redirections can be extended on demand, can't they?

@iipeace
Copy link
Owner

iipeace commented Oct 4, 2021

Yes, there was no option about it.
I implemented new options about it and you can test them using such below examples.

# ./guider.py btrace "ls" -q stdout:"./stdout"
# ./guider.py btrace "ls" -q stderr:"./stderr"

They will affect standard I/O of all child tasks.

@elfring
Copy link
Author

elfring commented Oct 4, 2021

Yes, there was no option about it.

Thanks for another constructive feedback.

# ./guider.py btrace "ls" -q stdout:"./stdout"

I imagined an other solution approach.
I hope that more data streams can be generally supported (like we are used to by the means of interactive shells).

@iipeace
Copy link
Owner

iipeace commented Oct 4, 2021

I hope that more data streams can be generally supported (like we are used to by the means of interactive shells).

How do you specify other data streams except for stdin, stdout, stderr?
could you share more detailed examples?
I can't understand ;)

@elfring
Copy link
Author

elfring commented Oct 4, 2021

How do you specify other data streams except for stdin, stdout, stderr?

Do you find the article “Linux Fundamentals – I/O, Standard Streams, and Redirection.” by Steven Vona helpful in this area?

I can't understand

Would you like to take another look in a manual from a popular shell?

@iipeace
Copy link
Owner

iipeace commented Oct 4, 2021

I got it.
You wanna use pipe from stdout or stderr of target task to stdin of other process?
Covering such all redirections is not small job ;)

How about making a new shell script for them?

@elfring
Copy link
Author

elfring commented Oct 4, 2021

Can a “shell” be chosen to resolve all configured redirections (similar to the way as it would usually happen in interactive mode)?

How about making a new shell script for them?

The evaluation of additional shell scripts might influence tracing approaches in undesirable ways, doesn't it?

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