[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] Impossible perl one-liner?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


<quote who="Jay Hannah">
> I dunno in a one-liner. I wrote an 18-liner and then stumbled into many
> ideas better than mine:
> http://perlmonks.thepen.com/117697.html

Thanks for the link -- I searched PerlMonks, but couldn't find this entry.
:(  For my limited needs, this appears to work:

# df -k | perl -pe 's/(?<=\d)(?=(?:\d\d\d)+\b)/,/g'
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c1t0d0s0    28,299,128 9,852,819 18,163,318    36%    /

And you're right -- the output is uglier now that the columns have no
chance to line up.  I might have to play with the "(?{ code })" you
mentioned to see if I can get it to work.

Thanks!

Dan

- - - - -
"I do not fear computer,
I fear the lack of them."
 -- Isaac Asimov
GPG fingerprint:9EE8 ABAE 10D3 0B55 C536  E17A 3620 4DCA A533 19BF

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFCOf3VNiBNyqUzGb8RAsUxAJ9V9xzZgORtaVZ7ubln0s+Fgj1j3wCeNwIZ
FYJHnSmSKVihNScEM+sWEOM=
=oj4P
-----END PGP SIGNATURE-----