0

In Terminal I'm running a program that includes setup config, which I want the output to go into a file, but it asks for input after about 10 seconds of "t" or "p". I want it to be "t". The "grep -v --line-buffered value" is where I do not want 'value' in the line to be saved to file.

Sort of like this...

./Program conf/program.conf |grep -v --line-buffered value> text.file
Only the program needs "t" to be issued.
./Program conf/program.conf | t | grep -v --line-buffered value> text.file
or 
./Program conf/program.conf ; sleep 10s;  t ; grep -v --line-buffered value> text.file

This of course these do not work, only works if Program is ended.

As a last resort, I could use "tee" command and split screen with file, then just wait 10 sec and enter "t". But I want this to be unattended, and execute on its own, with "t" entered by an automated means.

Thanks for any input..

  • try: echo t | ./Program ... – glenn jackman Dec 4 '17 at 21:25
  • or <<<"t" ./Program …. – dessert Dec 4 '17 at 21:56

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.