bash streams
I am working with loads of interactive scripts...
I usually run my script like this: ./script_that_runs_for_40_minutes_and_asks_million_questions < answers It's hard to make answers file without mistakes because there is always someone/something that interupts me... So is there a way to save all the answer I've typed to a file. like: ./script < (read the answer and save it to file) Thanx for your help! |
Clarification is needed:
- When running `./script < answers` what does the answers file look like? - Where do the questions come from? - Do you have to type anything when running the program? If the answers are in the answers file, why do you need to type anything else? What else do you need to type? - Regarding the script, do you have access to its source code? Regards, Entenbein. |
OK I'll reform my question.
Is there a program that can record stdin data in a file ? |
This might be adequate:
Code:
#!/bin/bash In this example the drawback is that ssh checks whether stdin is coming from a terminal, notices that it isn't, and so doesn't print the prompt as usual. You can still run ls, cd etc and see the output, it's just that you won't have a prompt. If your program doesn't try to be smart the above will probably be a tolerable solution. If that is no good then the nexty best option is to customise your program - doing so should be fairly straightforward. That failing I'd go with customising bash. I'd be happy to help with the last. Regards, Tischbein |
Thanx!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Thank you Tischbein !!
That's exactly what I've been looking for! Is there an index or something of all uncommon linux commands like tee ? |
All times are GMT -5. The time now is 11:04 AM. |