|
|
Subscribe / Log in / New account

Poettering: Revisiting how we put together Linux systems

Poettering: Revisiting how we put together Linux systems

Posted Sep 7, 2014 17:45 UTC (Sun) by jwakely (subscriber, #60262)
In reply to: Poettering: Revisiting how we put together Linux systems by mathstuf
Parent article: Poettering: Revisiting how we put together Linux systems

> Hell, I had to do "awk | awk" because system() output in awk only goes to stdout, not to a variable.

You can use awk's pipe operator instead:

cmd = "ls -l";
while ((cmd | getline x) == 1) xx = xx x "\n";
close(cmd);


to post comments

Poettering: Revisiting how we put together Linux systems

Posted Sep 8, 2014 5:15 UTC (Mon) by mathstuf (subscriber, #69389) [Link]

That should have a "see also" near the docs for system() in awk's manage. Thanks for the info at least.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds