hacker emblem

Submitted by admin on Wed, 2007-09-12 15:45.

Thanks to some feedback (thanks, Roland!), I came to realize that sort does actually work just fine in respect to its -z option:

sort -z < /proc/<PID>/environ | tr '\0' '\n'

does produce sorted output and as additional bonus now also works for variables with multi-line content. Silly me forgot to transliterate the null-chars to newlines after the sorting. Smiling

Reply

Please solve the math problem above and type in the result. e.g. for 1+1, type 2
The content of this field is kept private and will not be shown publicly.
  • Textual smileys will be replaced with graphical ones.
  • Lines and paragraphs break automatically.
More information about formatting options