(I think you meant to mail the list?)
Robert Heffernan wrote:
>> This one works ok:
> pppstats | sed 1d | awk '{print $1" "$7"\n"}'
> the sed bit strips the line that contains the heards (such as 'IN', 'OUT'
> etc.) from it
>> I have another short question. Is there a way to stick the output of said
> command into a variable and then return the said variable to the child
> process of the srript.
>> I'm actually running this script from a C program (using system()). The
> only thing I can think of at the moment is using
> pppstats | sed 1d | awk '{print $1" "$7"\n"}' > somefile
> and then in the C proggy, after running the script snarf the contents of
> somefile and deal with it.
> I fear this might create a lot of disk activity if I had the C prog doing
> this regularily (i.e. - almost constantly)
>> is there a better way?
>> thanks again
>> bob
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!