Jump to content
Tuts 4 You

C script to write output of a program to file


Kruse

Recommended Posts

Hey everyone,

I'm looking to learn how to write a c script I can run that will write the output of a program to another file. Do I just write a small c program that calls exec() and I can get the variables from there? I'm having a hard time searching for some kind of tutorial on what to do, can anyone enlighten me/point me in the right direction?

EDIT: So I now understand how to write a shell script to get the output of a program, this was apparently to easy to think of to start with... I'm now looking into how to get specific variables from the output/specific lines, say an output line starts with foo:, can I just get the output of this line?

EDIT II: I now understand the power of awk and a lot more about shell scripting, I've figured out what I needed after finally finding some tutorials on the matter.

Thanks,

Justin

Edited by Kruse
Link to comment

Maybe you could share the answers with the rest of the forum so others can learn if they are seeking the same answers?

HR,

Ghandi

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...