-1

I'm relatively inexperienced with bash scripting so I'm not sure if this is possible, but basically I'd like to write a bash script that

  • runs my program, which periodically prints logs to stdout
  • save all of the logs in a file
  • stop running the program, and analyse the logs

Is this possible? The program can be run in terminal using ./program -c config_file.txt -v

Cyrus
  • 84,225
  • 14
  • 89
  • 153
annedroiid
  • 6,267
  • 11
  • 31
  • 54
  • Please do not vandalize your posts. By posting on the Stack Exchange network, you've granted a non-revocable right for SE to distribute that content (under the [CC BY-SA 3.0 license](https://creativecommons.org/licenses/by-sa/3.0/)). By SE policy, any vandalism will be reverted. If you would like to disassociate this post from your account, see [What is the proper route for a disassociation request?](https://meta.stackoverflow.com/q/323395) – NobodyNada Oct 29 '17 at 04:04
  • this is not a question. Well, the answer to question as posted is "yes". – MK. Oct 29 '17 at 04:04
  • I believe all of your questions would have been answered immediately with a basic search. You should ask a specific question for a particular programming problem. Since Stack Overflow hides the Close reason from you: *"Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it."* – jww Oct 29 '17 at 04:42
  • I have asked a new question that is more specific, but I was asking because the answers I've found did not work for me, and I thought it might be my specific situation that was not feasible. – annedroiid Oct 31 '17 at 01:35

1 Answers1

0

You can redirect stdout to file in bash script for example you can alter your script

echo 'your output'

To

echo 'your output' >> logfile
user8848899
  • 181
  • 1
  • 3