MacPorts. Sometimes your ports are outdated. There’s a pseudo-portname for them. The report has many columns. And I only want the names, not their versions. port list outdated | awk ‘BEGIN { RS=”\n” } { print $1 }’ > names_of_old_ports.txt Done. Update: got a bug, fixed it. Sheesh. [tags]awk,unix[/tags]
Tag Archives: awk
Awk, text processing
Fooling around with load average output on a shared host (where it can be life-or-death): $ w -s|awk ‘/load average:/ { print “Load averages:\nPast 1 min: ” $10 “\nPast 5 min: ” $11 “\nPast 15 min: ” $12 }’ Load averages: Past 1 min: 20.94, Past 5 min: 20.67, Past 15 min: 18.75 What’s w, …